# Buttons and If Statements

**URL:** <https://forum.kirupa.com/t/buttons-and-if-statements/239282>\
**Category:** Uncategorized\
**Created:** [September 20, 2007, 6:17am UTC](https://forum.kirupa.com/t/buttons-and-if-statements/239282 "2007-09-20T06:17:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sance21](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Sance21](https://forum.kirupa.com/u/Sance21)\
**Post date:** [September 20, 2007, 6:17am UTC](https://forum.kirupa.com/t/buttons-and-if-statements/239282/1 "2007-09-20T06:17:11Z")

</div>

## I’ve created a button that’s actually a movie clip. If I know my button’s going to incorporate complex rollout/rollover animations, then I normally convert it to a movie clip symbol. I need this button to load an external swf file onRelease. How do I integrate the following if statement:

on (release) {

if (\_root.currMovie == undefined) {

\_root.currMovie = “about\_us”;  
container.loadMovie(“about\_us.swf”);  
} else if (\_root.currMovie != “about\_us”) {  
if (container.\_currentframe \>= container.midframe) {

\_root.currMovie = “about\_us”;  
container.play();

}

}

## }

into this button function

this.onRelease = function(){

## }
