# Problem unloading external swfs

**URL:** <https://forum.kirupa.com/t/problem-unloading-external-swfs/222585>\
**Category:** Uncategorized\
**Created:** [April 15, 2007, 1:16am UTC](https://forum.kirupa.com/t/problem-unloading-external-swfs/222585 "2007-04-15T01:16:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thefulton](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thefulton](https://forum.kirupa.com/u/thefulton)\
**Post date:** [April 15, 2007, 1:16am UTC](https://forum.kirupa.com/t/problem-unloading-external-swfs/222585/1 "2007-04-15T01:16:49Z")

</div>

I have several buttons in my cbtLoad layer (5 buttons) that are used to load external swfs into a movieclip holder for playing.

these all load fine and play. BUT when I press another button to load another swf in the current one’s place, nothing happens and the current swf keeps playing in a loop.

I need to have when a button is pressed the current swf stops and the new swf plays. Also I need these to not loop. one play through and then they either pause until a new button is pressed or they unload at the end of play, automaticly.

Any suggestions?

Here is the ActionScript that I am using with each individual button on the cbtLoad layer.

on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “external movie”;  
container.loadMovie(“eternal movie.swf”);  
} else if (\_root.currMovie != “external movie”) {  
if (container.\_currentframe \>= container.midframe) {  
\_root.currMovie = “external movie”;  
container.play();  
}  
}  
}

What code am I missing here? Thanks.
