stop();
var myRequest:URLRequest = new URLRequest(“welcome.swf”);
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showContent);
var myPreloader:Preloader = new Preloader();
function showPreloader(event:Event):void {
addChild(myPreloader);
myPreloader.x = stage.stageWidth/2;
myPreloader.y = stage.stageHeight/2;
}
function showProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading - " + Math.round(percentLoaded * 100) + “%”;
myPreloader.bar_mc.width = 198 * percentLoaded;
}
function showContent(event:Event):void {
removeChild(myPreloader);
addChild(myLoader);
}
logo.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {
gotoAndStop(1);
}
);
I’ve loaded external swf file, with a preloader in timeline 5.
I am trying to return to timeline 1 by clicking a button, but when i go back to time line 1,
the external file(welcome.swf) i loaded is appearing in timeline 1. How can I unload this?
I tried to insert myLoader.unload(); , but it isn’t working. Please some one let me know
what I can do to make swf unload.