To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 07-08-2008, 09:34 AM   #1
DonAlmighty
Member
 
Join Date: Jul 2008
Location: Manhattan, New York City. (New York City??)
Posts: 37
Question Can anyone explain or help me with stacking order (layers) in AS3

I am trying to set the depth of the of the movie clip that I created in AS3.

Basically I want the movie clip to be at the bottom of the stacking order. And it keeps appearing on top of my design or items I placed in the timeline


how can I make it so this object or movie clip is at the bottom or if I wanted to bring it to a different level?
DonAlmighty is offline   Reply With Quote
Old 07-08-2008, 01:21 PM   #2
neznein9
Ө_ө sleepy mod
 
Join Date: Mar 2003
Location: Oregon, USA
Posts: 2,330
Whenever you use addChild, the object is put on the top of the display list (highest z-index). You can use a couple different methods to manually set the index - also, remember that you have to use an index thats in bounds, you can only set an index to 100 if there are 100 other things on stage.

addChildAt(mc, 0); <= this will add to the back

addChildAt(mc, 10); <= this will add to layer 10 and bump anything already there

setChildIndex(mc, 20); <= this moves mc to index 20, bumping anything else

setChildIndex(mc, this.numChildren - 1); <= bring mc to the top

swapChildren(mc, mc2); <= switches the two

swapChildrenAt(0, 10); <= switches whatever is at 0 with whatever is at 10
neznein9 is offline   Reply With Quote
Old 07-08-2008, 08:00 PM   #3
DonAlmighty
Member
 
Join Date: Jul 2008
Location: Manhattan, New York City. (New York City??)
Posts: 37
Thumbs up Thanks

This cleared things up.. thanks. I saved this code.. I am sure I will be using it often now. Thanks again
DonAlmighty is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:28 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.