-
xml display problem
When you look at the trace option you see all the items, but the display shows the last item 26 times (the lengthof the array). This
vary same script works perfectly when used in a menu application.
function ParseXML() {
_level0.Item._visible = false;
var faults = new Array();
faults = myXML.firstChild.childNodes;
for(i=0; i<faults.length; i++){
item = attachMovie("itemClip", "itemClip", i);
item._x = 30
item._y =100+(27*i);
item.indication = faults[i].childNodes[1].firstChild.nodeValue;
trace(faults[i].childNodes[1].firstChild.nodeValue);
_level0.Item._visible = true;
}
}
ANY IDEAS, THIS IS DRIVING ME CRAZY
-
Senior Member
From the spec for AttachMovie:
newname A unique instance name for the movie clip being attached to the movie clip.
I would use:
PHP Code:
item = attachMovie("itemClip", "itemClip" + i, i);
Thanks
Luke
-
Thanks Luke- worked like a charm - What got me is I have a program to play cmputer based training using an auto genereated xml file from a MSword document. The menuing system works perfectly, generating the main an sub menu's. I can see why it might lose the data without a unique reference. Changed my other program just in case.
PS This is a nice routine for auto generating menu's from XML files.
-
Senior Member
It depends on where and how you are loading things. As always better safe than sorry (or hunting down unknown bugs in the future).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|