Jump to content
Search Community

How to unload an external SWF after 15 seconds?

learner_7n test
Moderator Tag

Recommended Posts

Hi,

 

I am using the following code to load an external SWF. I want to unload it after 15 seconds. How can I unload it? Please help me in this regard.

 

var mySwf1:SWFLoader = new SWFLoader("Clock.swf", {width:200, height:200, x:-300, y:-300, container:this, onComplete:completeHandler1});

mySwf1.load();

function completeHandler1(event:LoaderEvent):void {
TweenMax.fromTo(event.target.content, 3, {x:270, y:250, scaleX:.5, scaleY:.5, alpha:0}, {x:270, y:250, scaleX:2, scaleY:2, alpha:1, delay:3});
}

Thanks.

Link to comment
Share on other sites

try

 

var mySwf1:SWFLoader = new SWFLoader("Clock.swf", {width:200, height:200, x:-300, y:-300, container:this, onComplete:completeHandler1});

mySwf1.load();

function completeHandler1(event:LoaderEvent):void {
  TweenMax.fromTo(event.target.content, 3, {x:270, y:250, scaleX:.5, scaleY:.5, alpha:0}, {x:270, y:250, scaleX:2, scaleY:2, alpha:1, delay:3});


  TweenLite.delayedCall(15, mySwf1.unload)


}

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