排列在Flash对象使用ActionScript 3的(Z)命令?排列、命令、对象、Flash

2023-09-09 21:37:48 作者:只要有你

是否有可能安排在Flash中的对象(Z)为了用ActionScript 3?

Is it possible to arrange (z) order of objects in Flash with ActionScript 3?

例如。我有一个给定的层3元件实例,我想执行的置于顶层,前移,和/或仅面向特定z位置是等效的。

e.g. I have 3 symbol instances on a given layer, and I want to perform the equivalent of 'Bring to Front', 'Bring Forward', and/or target a certain z position.

推荐答案

您可以在同一层内使用动作脚本这样的更改影片剪辑的z索引(堆栈顺序)。

You can change the z-index (stacking order) of a movie clip within a same layer using action script like this.

parent.setChildIndex(childObject, i)

更改childObject到电影的名字剪辑您想要更改的z-index,改变我一个整数(所需的z-index值)。

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).

如果你想实现这一目标上的鼠标事件,把上面的code函数内附加一个事件侦听器添加到按钮上的鼠标事件调用该函数。

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.

 
精彩推荐
图片推荐