# On Release Function Help

**URL:** <https://forum.kirupa.com/t/on-release-function-help/251270>\
**Category:** flash\
**Created:** [February 6, 2008, 7:11pm UTC](https://forum.kirupa.com/t/on-release-function-help/251270 "2008-02-06T19:11:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![briand5](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@briand5](https://forum.kirupa.com/u/briand5)\
**Post date:** [February 6, 2008, 7:11pm UTC](https://forum.kirupa.com/t/on-release-function-help/251270/1 "2008-02-06T19:11:22Z")

</div>

Hi, I need a little help writing a function that loads two separate SWF files by clicking a button. Here is my current code:

> 

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

My first SWF file (slash.swf) will load but the second file will not. The problem I am having is because of the coding for the outro in each of the SWFs. I know regularly is would be:

> 

on (release) {  
slash\_container.loadMovie(“slash.swf”);  
container.loadMovie(“merch.swf”);  
}

But with all of this extra code I am not sure what to do.

Thanks for all of the help,  
Brian
