Jump to content
Search Community

LoaderMax - how can I find a loaded swf

Dcoo test
Moderator Tag

Recommended Posts


Trying to tween a swf loader


var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,oncomplete:completeHandler,onError:errorHandler,maxConnections:5});

 

queue.append( new SWFLoader("shoeHorn.swf", {name:"start", estimatedBytes:1363148.8, container:this,  autoPlay:true,visible:false,onComplete:completeHandler}) );

queue.append( new SWFLoader("yourvids.swf", {name:"yv", estimatedBytes:1080, container:this,  autoPlay:false,visible:false}) );

queue.append( new SWFLoader("book_Luanch.swf", {name:"bookl", estimatedBytes:10670, container:this,  autoPlay:false,visible:false,x:0,y:0,width:1000,height:600}) );

LoaderMax.prioritize("shoeHorn.swf");

 

 

queue.load();

 

 

 

 

function progressHandler(event:LoaderEvent):void

{

trace("progress: " + event.target.progress);

 

 

}

 

 

function errorHandler(event:LoaderEvent):void

{

trace("error occured with " + event.target + ": " + event.text);

 

 

}

 

 

 

 

function completeHandler(event:LoaderEvent):void

{

TweenLite.from(event.target.content, 0, {x:0,y:0,autoAlpha:1})

 

 

setChildIndex(Object(root).spauseBtn,numChildren - 1);

TweenLite.to(splayBtn, 1, {autoAlpha:1 });

TweenLite.to(Object(root).fullScreenBtn, 2, {autoAlpha:1})

 

 

trace("it worked!");

}

 

function bookon():void

{

 

 

TweenLite.to(bookl.content, 1, {autoAlpha:1});

 

 

}

 

Link to comment
Share on other sites

You named your SWFLoader "book1", but that has nothing to do with the DisplayObject's name, and it seems like that's what you're trying to reference. I'm a little fuzzy on what you're trying to do, but maybe it's something like this:

TweenLite.to(LoaderMax.getContent("book1"), 1, {x:0,y:0,autoAlpha:1});

?

Link to comment
Share on other sites

Thanks Jack,
So I'm trying to see if I could tween the Alpha of bookl so I could possiblytoggle it off and on.
 
function bookon():void is called from inside shoeHorn.swf
 

var parentMovie:MovieClip = this.parent.root as MovieClip;
parentMovie.bookon();
 
I gave the code a try
TweenLite.to(LoaderMax.getContent("book1"), 1, {x:0,y:0,autoAlpha:1});
doesn't seem to do the trick, bummer

Link to comment
Share on other sites

I'm pretty confused about how you've structured things - feel free to post a super simple example set of files that can be published on our end. Please don't send us all the regular production files with everything (it's too time-consuming to pick through all the code and figure out which things matter) - just a simplified set of files is great. 

 

Are you asking how to fade the alpha of the content of a particular SWFLoader or are you asking how to call a particular method that's inside a subloaded swf? 

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...