A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: xml display problem

  1. #1
    Member
    Join Date
    Jul 2001
    Posts
    61

    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

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    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" ii); 
    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Member
    Join Date
    Jul 2001
    Posts
    61
    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.

  4. #4
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    It depends on where and how you are loading things. As always better safe than sorry (or hunting down unknown bugs in the future).
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center