i have a bit of code that gets information from an xml file and loads it into a movie clip that i made. this works great for one result, but i want it to keep going so it duplicates the movie clip and brings out the other results. so far ive been able to duplicate the movie clip and place it at x & y co ords coming from the xml. but the rest of the information isnt coming through. any help would be great.
This is the code i have at the moment.
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(){
imageList = this.firstChild.childNodes;
showImages(imageList);
}
myXML.load(“gallery1.xml”);
E4X is a way of operating on and sifting through XML with simple syntax.
You should go through your XML as follows:
//the .. in myXML..image means find all image nodes in MyXML (regardless of how nested)
//this for each loop will go through each image node
for each(var image:XMLNode in myXML..image)
{
//DO STUFF HERE on each image node
//use image.@attributeName to access the attributes of the node
//(ie: image.@xval will get the value of xval for this node).
}
sorry but i havent got a clue what to do with that, wot ive got for the xml works fine, its the flash thats giving me probs, however ive figured out what i need to do, just dont know how to do it. (see below).
info.duplicateMovieClip(“info_”+i, i+1); [COLOR=red]on this line is the variable ’ i ’ [/COLOR]
info.name_txt.text = nametxt; [COLOR=red]------ what i need to do is add the variable i to this instance name, making it info_1 then info_2 etc…[/COLOR]
info.address_txt.text = address; [COLOR=red]simply adding it, eg info+i doesnt seem to work [/COLOR]
info.phone_txt.text = phonetxt;