Archive for April 7th, 2008

07
th April, 2008

Flash CS3 z-index, display index, etc…

Slipped under Ramblings

If you’re a noob in Flash, looking for z-index in AS3. well, there isn’t one.

There used to be a property called depth. But now it has become an index of the array object.

So for example, you add a dynamic object into Flash MainTimeLine at runtime. your “z-index” is your index within the MainTimeLine’s object array.

To set the index. Use setChildIndex(childObject, i); where childObject is the object in question, i is an integer. This would add the child into that index and move the “original occupant” and everything above that up by 1.