bring object to front flash actionscript 3

steve picture steve · May 23, 2010 · Viewed 21.8k times · Source

I have a menu set up that has about 20 menu items in a circle. When you mouse over each item, a title comes up. The only problem is that because of the depth order, it's hidden behind the other menu items. Is there a way to bring this item to the front when moused over? I'm pretty actionscript illiterate so any help would be awesome.

Answer

Patrick picture Patrick · May 24, 2010

If you don't want your object being removed and then added to the display list using addChild you can use setChildIndex

var parent:DisplayObjectContainer = myElement.parent;
parent.setChildIndex(myElement, parent.numChildren-1);