yeah, sorry, damn copy&paste ;) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Wednesday, August 02, 2006 2:53 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] New to the list - got a question
>>_root._level0.[" _root._level0? Just _level0 should suffice. There's only 1 _level0. Jason Merrill Bank of America Learning & Organization Effectiveness - Technology Solutions >>-----Original Message----- >>From: [EMAIL PROTECTED] [mailto:flashcoders- >>[EMAIL PROTECTED] On Behalf Of André Goliath >>Sent: Wednesday, August 02, 2006 8:50 AM >>To: 'Flashcoders mailing list' >>Subject: RE: [Flashcoders] New to the list - got a question >> >>Use the Array operator liek this >> >>var x = 6; >>_root._level0.["itemDividerStageRecord"+x]._x = nextItemDivider; >> >>hth >> >>-----Original Message----- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On Behalf Of Jon >>Sent: Wednesday, August 02, 2006 2:45 PM >>To: flashcoders@chattyfig.figleaf.com >>Subject: [Flashcoders] New to the list - got a question >> >>Hi All, >> >>I'm new to the list, so appologies if I don't get the posting right on this >>- but I have a question. >> >>I'm trying to load in a set of XML data, manipulate it and then get it to >>display on the stage. So far so good on the first two fronts - I can get the >>data in and get everything I want out of it. >> >>Now the amount of XML is dynamic, so I have pushed the needed data into an >>array. >> >>For example. >> >>XML: >> >><xml> >> <data> >> <item></item> >> </data> >> <data> >> <item></item> >> </data> >></xml> >> >>The amount of "data" elements is dynamic (and there is a lot of other >>rubbish in the XML) so I've pushed all the "data" elements into an array. >> >>So far, so good, I can cycle through the array and access the XML elements >>using Xpath. >> >>The problem is - for each "data" element, I want to create a new instance of >>a MovieClip on the stage (thats already created in the library) and set >>varaibles inside it, and change it's X and Y positions. >> >>No problems creating it - but I can't access the MovieClip! Because the data >>is dymanic, I need to be able to create "x" amount of MovieClips. >> >>So I'm using the following code to do this: >> >>//For each Data Element in the Array (x = 0; x < numDataElementsInArray; >>x++) >>{ >> var newItemDividerName:String = "itemDividerStageRecord" +x; >> attachMovie("itemDivider", newItemDividerName ,x); >> >>//Now this all works, a newMovieClip is created on the stage (for as many >>elements as I have), 10 at the moment >> >>} >> >>Now the problem is - I then can't access the MovieClip dynamically. >>Basically I want to be able to access it by the variable name >>i've just assigned it. >> >>For example - I now have (when it is published), 10 elements on level0, >>named itemDividerStageRecord0-9. >> >>So I want to set their cords. So what i've been doing is: >> >>_root._level0.newItemDividerName._x = nextItemDivider; //nextItemDivider is >>a Number which does increment >> >>And thats not working at all - nothing is changing. >> >>I've traced it down to the name I'm using to access it - if in the same loop >>I put: >> >>_root._level0.itemDividerStageRecord6._x = nextItemDivider; >> >>That works for one MovieClip (obviously). >> >>But I want to be able to access each MovieClip dynamically. >> >>Is there any way to do this? I want to pass the instance name the varaible >>when setting the cord, not use the absolute element name >>"newitemDividerName". >> >>Please let me know if this is confusing, I can explain better! >> >>Cheers. >> >>-Jon- >> >>_______________________________________________ >>Flashcoders@chattyfig.figleaf.com >>To change your subscription options or search the archive: >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >>Brought to you by Fig Leaf Software >>Premier Authorized Adobe Consulting and Training >>http://www.figleaf.com >>http://training.figleaf.com >> >>_______________________________________________ >>Flashcoders@chattyfig.figleaf.com >>To change your subscription options or search the archive: >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >>Brought to you by Fig Leaf Software >>Premier Authorized Adobe Consulting and Training >>http://www.figleaf.com >>http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com