# Help unloading external swf file

**URL:** <https://forum.kirupa.com/t/help-unloading-external-swf-file/251681>\
**Category:** Uncategorized\
**Created:** [February 11, 2008, 6:25pm UTC](https://forum.kirupa.com/t/help-unloading-external-swf-file/251681 "2008-02-11T18:25:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mukkebbi](https://avatars.discourse-cdn.com/v4/letter/m/a183cd/32.png) [@mukkebbi](https://forum.kirupa.com/u/mukkebbi)\
**Post date:** [February 11, 2008, 6:25pm UTC](https://forum.kirupa.com/t/help-unloading-external-swf-file/251681/1 "2008-02-11T18:25:07Z")

</div>

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.
