The display list is managed as a stack. New items go on top when you add them by default. So the first item you added will have index 0. If you addChild() again, the new child will be at index 1.
If you want to get the topmost child, you can do: container.getChildAt(container.numChildren - 1); Cheers Juan Pablo Califano 2010/4/28 Lehr, Theodore <[email protected]> > ok - so I am trying this: > > var curChild=getChildByName(e.currentTarget.name<http://e.currenttarget.name/> > ); > var curIndex:int=getChildIndex(curChild); > trace(curIndex); > > and it seems as though it is counting from the back up... so if I have 12 > mcs, then the one no top will trace 12... I would think the one on top would > be 1.... I would love to just set it to 1 to make it come to the top and > then reset it back to it's original number to put it back.... any > thoughts.... > > ________________________________________ > From: [email protected] [ > [email protected]] On Behalf Of Nathan Mynarcik [ > [email protected]] > Sent: Wednesday, April 28, 2010 1:51 PM > To: Flash Coders List > Subject: Re: [Flashcoders] arranging > > Will getChildIndex and setChildIndex not work either for static objects? > > > -----Original Message----- > From: "Lehr, Theodore" <[email protected]> > Date: Wed, 28 Apr 2010 13:38:39 > To: Flash Coders List<[email protected]> > Subject: RE: [Flashcoders] arranging > > the issue is that these are mcs that are NOT put there in as but in the > IDE.... I tried getChildIndex and it says that this is for display objects - > not static objects... any way to change order with static objects? > > ________________________________________ > From: [email protected] [ > [email protected]] On Behalf Of Nathan Mynarcik [ > [email protected]] > Sent: Wednesday, April 28, 2010 1:33 PM > To: Flash Coders List > Subject: Re: [Flashcoders] arranging > > addChild(mc) normally brings them to the top. > ------Original Message------ > From: Henrik Andersson > Sender: [email protected] > To: Flash Coders List > ReplyTo: Flash Coders List > Subject: Re: [Flashcoders] arranging > Sent: Apr 28, 2010 12:13 PM > > Lehr, Theodore wrote: > > If I have mcs that are put on the same layer in the ide - how can I > change their order (i.e. send to back, bring forward) in as3? > > They will still have different indexes on the display list. Just do the > same old stuff as usual. > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

