Jump to content


LoaderMax into layers

Moderator Tag

Recommended Posts



So I'm not a fantastic flash coder.. but I'm in the middle of a project that I need a little help on. I have some code, which works very well, with one thing that I cannot figure out how to change. I'd like to be able to put other art on top of the loaded SWF.. but it only loads in the topmost "z" index, and even if I put another layer over the top with art to overlay, it just loads over it..


var queueb1:LoaderMax = new LoaderMax({onProgress:progressHandlerb1, onComplete:completeHandlerb1, onError:errorHandlerb1});
queueb1.append( new SWFLoader("whitley.swf", {name:"whitleySWF", estimatedBytes:3000, container:this, autoPlay:false}) );
function progressHandlerb1(event:LoaderEvent):void {
    trace("progress: " + event.target.progress);
function completeHandlerb1(event:LoaderEvent):void {
    var image:ContentDisplay = LoaderMax.getContent("whitleySWF");
image.y = -65;
    trace(event.target + " is complete!");
function errorHandlerb1(event:LoaderEvent):void {
    trace("error occured with " + event.target + ": " + event.text);
Can you tell me what I need to do to this code so it loads on a specific layer? I also have a symbol that I've been using as a mask, it'd be perfect if I could load it into it.
Link to comment
Share on other sites

Yes, instead of using container:this, you can specify ANY DisplayObjectContainer to load into (typically a MovieClip or Sprite). 


When you use container:this, the loaded item just gets loaded on the next available stacking index. If you use your own container movie clip, its very easy to place that container above or below other assets. To place an object above your loaded swf in its custom container just use addChild()

//create a new movie clip with actionscript or use one from the library
var holder = new MovieClip();

var swf:SWFLoader = new SWFLoader("someSwf", {container:holder});

addChild(someOtherClip); //will go on top of holder


You can read more about depth management here:






  • Like 1
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.