-
Depth in AS3
I am using AS3. I have two instances on stage on the same spot. One of them is called "shape1" and it is on top of the other one. How can I change depth using AS, so that shape1 is under the other instance.
Any help would be appreciated.
-
Several ways to do this, but if you just want to overlap shape1 and shape2 movieclips, then you can use swapChildren to swap the depths.
Actionscript Code:
this.swapChildren(shape1, shape2);
You can read more about change depths in this article:
http://www.adobe.com/devnet/flash/qu...mming_as3.html
-
Developing For Dunkets
swapChildren is fastest. If you have more than two shapes and you're managing their depths then you'll want to use something like setChildIndex and get the top value using numChildren
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|