# Play exit animations on multiple external SWF's?

**URL:** <https://forum.kirupa.com/t/play-exit-animations-on-multiple-external-swfs/191391>\
**Category:** flash\
**Created:** [June 20, 2006, 5:11am UTC](https://forum.kirupa.com/t/play-exit-animations-on-multiple-external-swfs/191391 "2006-06-20T05:11:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattMDesign](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@MattMDesign](https://forum.kirupa.com/u/MattMDesign)\
**Post date:** [June 20, 2006, 5:11am UTC](https://forum.kirupa.com/t/play-exit-animations-on-multiple-external-swfs/191391/1 "2006-06-20T05:11:12Z")

</div>

Hi,

Here is what I would like to do: I have some buttons, then 2 movie clips named container and container2. When I click on a button, an external SWF is loaded into container. I have it working so that when another button is clicked, it plays the exit animation of the current SWF, then loads the new one. Here is the code that I used for that:  
on a button:

```auto

on (release) { 
if (_root.currMovie == undefined) { 
_root.currMovie = "who"; 
container.loadMovie("who.swf"); 
} else if (_root.currMovie != "who") { 
if (container._currentframe >= container.midframe) { 
_root.currMovie = "who"; 
container.play(); 
} 
} 
}

```

In who.swf frame 1:

```auto

midframe = 114;

```

In who.swf last frame:

```auto

_root.currMovie = undefined;
stop();

```

Frame 114 is where the exit animation starts.

What I would like to do, is have a button in who.swf, that will load another external swf into container2, while leaving who.swf in place. Then, when one of the main buttons is clicked, I would like it to play the exit animation of the swf that is currently in container2, then play the exit animation of the swf that is currently in container, then load the new swf into container. Can someone please help me out with the code for that?

Thanks!
