James Simpson
James Simpson

Reputation: 13718

AS3: Increase Child Index by 1

How would I increase the child index of a movie clip by 1?

Upvotes: 2

Views: 10311

Answers (2)

sksizer
sksizer

Reputation: 221

fenomas is correct. It is also important to note that in AS3 there are no gaps in the child display lists so in order to move it higher in the stacking order there must be other children in the display list to swap with.

A good resource is here -> http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_04.html

Upvotes: 0

fenomas
fenomas

Reputation: 11139

Do you mean move it one level higher in its parent's stacking order? Then you do it by swapping it with the clip above it. Like this:

var index:int = myMC.parent.getChildIndex( myMC );
myMC.parent.swapChildrenAt( index, index+1 );

If that's not what you want to do, maybe you could expand on what you mean by child index?

Upvotes: 5

Related Questions