• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

I need some ideas, comments .....

I currently have an application (exe) that outputs an xml file. A restriction on that file is it can only have one name, for eg.

now, should you want to output different items, without overwriting the first, this means you need to make multiple copies of your files everywhere, so the user wants to be able to have multiple xml files only.

a compiled swf reads in the xml file and outputs accordingly. I need ideas and ways on how to parse an xml filename to that swf at runtime. for e.g if the swf is in a html/asp type page, could parse through a query string, or maybe add a frame to the player for the user to load the xml in question or something to that effect.

secondly, the application has a browse for assets button, those assets however will only work at final runntime if in the same location as the compiled swf, is there a way in which i can force a file to be created in the correct location if it doesn't already exist. For example, dreamweaver does that, if you want to insert something that's not in the site, it asks if you want to create a copy in the site. How would I go about that?

Any ideas?

thanks ppl
  • 3
  • 3
1 Solution
I'm not getting what you are asking, for the part I understand, I can say the following:

- You can not write to a (xml) file from flash, you need php, asp or flash remoting for this.

- If the swf is in a asp page, you can have the asp write the object tag, that refers to the swf. You can add parameters in this object tag, that apear as _root.variable in the flash movie: here is some javascript that does that, the parameter is called movie

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
if (isNaN(parseInt(words[i])))
var MM_PluginVersion = words[i];
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
if ( MM_FlashCanPlay ) {
document.write('<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
document.write('  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,79,0,0" ');
document.write(' ID="SNFlash" WIDTH="163" HEIGHT="98"  ALIGN="none">');
document.write(' <PARAM NAME=movie VALUE="/Butcms/Communities/Petersime/Themes/Petersime/Images/salesmap_home.swf?linkParam=dynamiclink.aspx?sectionId=116"> <PARAM NAME=loop VALUE=false /> <PARAM NAME=menu VALUE=false /> <PARAM NAME=scale VALUE=noscale /> <PARAM NAME=wmode VALUE=transparent /> <PARAM NAME=salign VALUE=T /> <PARAM NAME=quality VALUE=AutoHigh/> <PARAM NAME="allowScriptAccess" value="SameDomain" />  ');
document.write(' </OBJECT>');
} else{

about first question, why not to make the logic in xml itself, make additional node for each new file you wanted to create.
the second question I did understand, create files with what?
blue-genieAuthor Commented:
wait, maybe i didn't explain properly.

currently, the app (don't worry about outputting xml and all that- its done it all works) outputs a file called flash.xml

there's a swf called player.swf which looks for a file called flash.xml, loads it and does its thing.

I want the player.swf to be able to load any xml file, so i want to be able to change my app to output flash2.xml or flash3.xml, and i want to know different ideas on how to get player.swf to know which xml to load.

the second part, Buffon, not sure what you mean by "create files with what".

assume i have a pic called test.jpg in "My Pictures" and my app is installed in C:\APP
player.swf also resides in C:\APP, and so does flash.xml

so now, in order for player.swf to load flash.xml and all the subsequent assets like test.jpg, test.jpg needs to be in C:\APP as well. Currently, the user will use a browse button and locate the test.jpg in "My Pictures" - I want a way then to check, that pic doesn't exist in C:\APP - pop up a msg telling the user so, and ask to make a copy in C:\APP.



Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

for the first question, I think the best way, is the one I posted in my previous post, generate a parameter in the object code.

the second question, assuming you are talking about the "app", in what language did you write it?

blue-genieAuthor Commented:
the app is a flash swf in a C# wrapper.
check if the file exists in C#, ask the question in a msgBox, then do whatever he wants in C# again. You don't need any flash for that right?

blue-genieAuthor Commented:
ok, wim, the c# guy gave me a nod on that bit. ok so that bit solved.

then, the other thing.

your solution wiill require a hard coding of the query parameters yeah?
i can't expect the end user to know how to go and change that. Maybe I'm not understanding it correctly.

I'm currently working on a solution in the flash, the player swf has to be web enabled, i.e can't be an exe.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now