Copy link to clipboard
Copied
I am using the following code to load an external SWF file. I would like to unload the same SWF file (Clock.swf) after 10 seconds (automatically). How can I? I am using greensock Class.
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
import com.greensock.events.LoaderEvent;
var mySwf1:SWFLoader = new SWFLoader("Objects/Clock.swf", {width:200, height:200, container:ClockContainer, onComplete:completeHandler1});
mySwf1.load();
function completeHandler1(event:LoaderEvent):void {
TweenLite.to(event.target.content, 0,{alpha:0});
TweenMax.fromTo(event.target.content, 3, {x:0, y:0, width:200, height:200, alpha:.1}, {x:0, y:0, width:200, height:200, alpha:1, delay:.5});
}
Unload:
mySwf1.dispose(true);
Unload after 10 seconds:
setTimeout(function () {mySwf1.dispose(true);}, 10000);
Copy link to clipboard
Copied
Unload:
mySwf1.dispose(true);
Unload after 10 seconds:
setTimeout(function () {mySwf1.dispose(true);}, 10000);
Copy link to clipboard
Copied
Thanks a lot.
Copy link to clipboard
Copied
You're welcome.