Multiple xml flash
- Started
- Last post
- 13 Responses
- fues
How come that when I try to load more than one xml-file into Flash (load actions are on a keyframe), it will only load one xml-file?
Thanks so much.
- unfittoprint0
I would advice to do it sequentially. at the end of each onLoad event load the next xml 'in line'.
- fues0
Hi Unfit, I think I wasn't clear enough.
This is the script I have: http://dislogic.be/script.rtf
Now, what I want to do is make two rows of buttons (one row is work.xml and the other is artists.xml) , each time you press one an image is loaded into the loadclip.
The loading of the images works, the only thing that doen't work is my second row (work.xml). I have assigned the _y coordinate of both rows in the sector 'attribute'..
- unfittoprint0
ok. one thing that I always do is to put the XML.load("file.xml") after everything.
why? It might result while testing offline, but it will not function online.
Every code has to be done sequentially.
Only after you created the Objects and their onLoad event functions, you should start loading them.so this:
artistXml.load("xml/artists.xml...
workXml.load("xml/work.xml");should be put at the end.
- fues0
Thanks Unfit, it hasn't solved the problem though..
- unfittoprint0
hmmm... instead of this:
workXml.onLoad = loadXML;try
workXml.onLoad = function(success){
if(success){
loadXML();
} else{
trace("error")
}
}
- fues0
It loads both xml-files but just doesn't put the second row on the other _y coordinate (attribute 'sector')..
- unfittoprint0
u have:
item._y = menuItem[0].attributes.sector;shouldn't it be
item._y = menuItem[a].attributes.sector;
- fues0
Logically yes... tried it but nothing. Very weird..
- unfittoprint0
when dealing with xml load, trace is your best friend.
and it may have something to do with your xml file. check its structure.
good luck.
- fues0
Thanks for your help Unfit.
- JazX0
unfittoprint is a 'God Among Insects' in this department.
- fues0
True Jaz, but what are you insinuating?
- JazX0
just playing