There is an xml file named:“menu.xml”. It’s path is “C:\menu.xml”.And its code is:
<menu>
<mainitem>
<item>Alphabet</item>
<subitem>A</subitem>
<subitem>B</subitem>
</mainitem>
</menu>
The actionscript written to open the file is :
myXML= new XML();
myXML.load(“C:\menu.xml”);
myXML.onLoad=loaded(success);
function loaded(success){
if(success) {trace(“Ok”);}
else {trace("! Ok");}
}
When the movie is “run” the following error occurs:
Error opening URL “C:\enu.xml”
My question:The file name is menu.xml but the error statement calls it enu.xml! Why?
Also why doesn’t the xml file load into the movie?
Well I didn’t set up any test files, but I noticed a few things wrong right off the bat…
You are exporting as Flash 5, go to File/Publish Settings and click on the Flash tab and choose Flash 6. Otherwise the dynamic event handlers won’t work.
myXML.load(“C:\enu.xml”)… enu.xml? Is that correct?
myXML.onLoad = loaded(success)… should be myXML.onLoad = loaded
since i don’t have flash 6 i open the swf file in frhed and change it to flash player 06. then i open the file in flash player 06.(thanks to senocular,for the idea)
And when I tested the movie I got a textbox that said “Successfully Loaded!”
BTW: I added ignoreWhite in there because that is something you should always do when loading in XML. It removes all the excess/useless whitespace from the XML file.
lost, all the above xml actionscript existed in Flash 5, so no pb with that…
java, when using test movie locally, always test with any files you wanna load in the same folder as your fla/swf, lots of bugs come from there! might just be that you need to escape the \ with \… try…
to eyez:I use most of the actionscript commands and functions in flash mx for my flash 5 files. I open frhed and convert the .swf into flash player 06 format.(thanks again senocular).
I remember when sen posted the way to get Flash 5 files to act as Flash MX files so you can use the sintax, but I don’t know if it works as well, so I don’t know if this works.