[CS3] Problem finding xml file
I'm new at this so bear with me.
The flash file that I'm using is not able to find the xml file when in a different folder.
If I have a menu.htm, menu.xml and menu.swf in the same folder everything works great.
What I want to do is have the files menu.xml and menu.swf in <scripts> folder that can be called from any other folder like <training> <root> or <guestbook>.
so I have
root
-<images>
-<scripts>
-<guestbook>
-<training>
Here is what I have in html for flash
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="800" height="200" id="menu" align="middle">
<param name="allowScriptAccess" value="sameDomain" >
<param name="allowFullScreen" value="false" >
<param name="movie" value="menu.swf" >
<param name="quality" value="high" >
<param name="bgcolor" value="#333333" >
<embed src="menu.swf" quality="high" bgcolor="#333333" width="800" height="200" name="menu" align="left" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
Here is what I have for code in menu.fla
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("menu.xml");
I'm not sure what I'm missing.
I fiddled with the htm page at set <embed src="../scripts/menu.swf" etc.
That seems to help but the xml file isn't being found.
I tried using the full url to where the xml file is.
Any ideas?
[CS3] Problem finding xml file
I modified the code
<param name="movie" value="scripts/menu.swf" >
<embed src="scripts/menu.swf"
This worked in the case where the menu.htm file is in the <root> and the xml & swf file are in the <scripts> folder.
I tried this senario - if the htm file was in <training> folder
This should work but doesn't
<param name="movie" value="../scripts/menu.swf" >
<embed src="../scripts/menu.swf"
The swf file is not viewable either.
This is just simple html so I would think it should work.
I also tried this senario
I used a different swf file that was not dependent on a xml file to specify the menu structure for the swf file
All the code mentioned above worked.
I might try a JavaScript approach to load the swf file if all else fails.
I also tried a code change in the flash file for
my_xml.load("../scripts/menu.xml");
I don't think that's it yet because I still should be able to at least view the swf file.
Any ideas?
1 Attachment(s)
[CS3] Problem finding xml file
Here are the files I'm testing with.
I tried deploying to a different web server to see if that is causing problems.
It was to some extent.
Basically the files will only work if the asp/htm, swf and xml are in the same folder. I can put the js file in a <scripts> folder. that works.
See what you think.
Thanks for the help
[CS3] Problem finding xml file
Excellent. That does exactly what I wanted it to do. Thank you very much.
I see the changes in the fla file for my_xml.load.("../scripts/menu.xml");
In the asp you changed the lines of code
<param name="movie" value="../scripts/menu.swf" >
<embed src="../scripts/menu.swf"
and some in the Javascript function AC_FL_RunContent.
Was there anything else that was changed ?