Jump to content
Search Community

Can you pick what layer to load a SWF on?

DarkBrainComics test
Moderator Tag

Recommended Posts

My root stage has several layers, one I want to be on top of swf clips I load using LoaderMax. Although I can easily manage x and y, I don't see a z index to control where the movie is placed, nor does using "this" as the container (with the action script on the bottom layer) do anything. The SWF always loads on top of everything else. Is there an easy way to manage the z index and put loaded SWFs exactly where I want them?

Link to comment
Share on other sites

Sure, you can put them wherever you want. When you create a SWFLoader (or ImageLoader or VideoLoader), it automatically creates a ContentDisplay object (a special Sprite into which the rawContent is loaded). If you define a container, it will immediately addChild() to that container, but you can addChidlAt() wherever you want instead. Like if you want to put it at the bottom layer/level, you could do:

 

var loader:SWFLoader = new SWFLoader("child.swf");
this.addChildAt(loader.content, 0);
loader.load();

 

Make sense?

Link to comment
Share on other sites

Thank you - worked great! I had been using .append(new SWFLoader()) type of lingo but I could not get it to be on the bottom, but pulling out the loader and then placing via addChildAt it did the trick!

 

var loader:SWFLoader = new SWFLoader(mySWFFile, {name:"myName", x:0, y:1200, autoPlay:false});

this.addChildAt(loader.content, 0);

SceneQueue.append(loader);

SceneQueue.load();

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...