views:

86

answers:

3

I'm working on a actionscript 3 flash file wherein I want to use multiple .swfs to load at various points.

I'm using the loader class and addChildAt to add these swf files to the display list. However, I'd like to keep one or more files above everything else, and have the rest of the swf files load directly under the top most swf files.

Is there any way to keep an object or loaded swf on top of the display stack? Or is there any way to get actionscript 3 to work like actionscript 2, where I could just load these objects into much higher levels?

A: 

To keep a child at the top, you could use like swapChildren(mc, getChildAt(numChildren - 1));

Chris Gutierrez
A: 

You could write a component that would load things where you want them. But that would just use the technique that you're already using. What's the problem with it?

ablerman
At some points I'm adding objects to the display list through time lines. And they end up on top.
anonthing
+1  A: 

Why not create two Sprite/Movieclip containers, containerBottom and containerTop, at depths 0 and 1 respectively? Add all the content you want to stay on top into containerTop and add all the content you want below into containerBottom. Then the only thing you'll have to keep track of is the depths of your content within these respective containers.

heavilyinvolved
I think I can make it work like this, thanks.My only questions is, what would qualify as a container in actionscript 3?
anonthing
Any DisplayObjectContainer will qualify... just depends on how you intend to use it. In your case I would suggest a Sprite: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/
heavilyinvolved