开发者

Change order of layers in Flash MovieClip with ActionScript?

开发者 https://www.devze.com 2023-01-19 06:28 出处:网络
Is it possible to change the orde开发者_开发百科r of layers in a Flash MovieClip timeline using ActionScript 3?You cannot change the layer order, but you can change the z-index (stacking order) of a m

Is it possible to change the orde开发者_开发百科r of layers in a Flash MovieClip timeline using ActionScript 3?


You cannot change the layer order, but you can change the z-index (stacking order) of a movie clip within a same layer. So you can consolidate all the relevant movie clips into one layer, then change the z index using acrtionscript.

parent.setChildIndex(childObject, i)

Change childObject to the name of the movie clip you want to change the z-index, change i to an integer (the desired z-index value).

If you want to make this happen on a mouse event, put above code inside a function and attach an event listener to a button to invoke this function on a mouse event.

0

精彩评论

暂无评论...
验证码 换一张
取 消