开发者

Issue changing the depth of an onscreen object through actionscript

开发者 https://www.devze.com 2022-12-23 22:28 出处:网络
Hi my designer made a fla file where he has animated layers loads of them. All the images inside those animations are loaded from outside the swf.

Hi my designer made a fla file where he has animated layers loads of them. All the images inside those animations are loaded from outside the swf.

Now, the issue is at one point in time 开发者_如何转开发I want some of the objects to go under another object ( current their on top) . If I do this visually the images inside the swf(loaded) are lost.

Any ideas?

Fahim.


In AS3 you can re-parent a DisplayObject by using

newParent.addChild(myMC);

The great thing about this way in AS3 (as opposed to AS2) is that the depths are taken care of automatically.

An easy way to move a clip to the top (if there are multiple clips attached to the same parent) is just call myParent.addChild(myClip). You can do this even if it is already a child of myParent, and doing this will just move myClip to the top of the stack.

So to solve your dilemma, you should be able to use this method to move your topmost clip to the top of the stack before you need the others to go under it.

0

精彩评论

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

关注公众号