# Flash If Else Button Statement

**URL:** <https://forum.kirupa.com/t/flash-if-else-button-statement/270877>\
**Category:** flash\
**Created:** [September 15, 2008, 7:38pm UTC](https://forum.kirupa.com/t/flash-if-else-button-statement/270877 "2008-09-15T19:38:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![csr500](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@csr500](https://forum.kirupa.com/u/csr500)\
**Post date:** [September 15, 2008, 7:38pm UTC](https://forum.kirupa.com/t/flash-if-else-button-statement/270877/1 "2008-09-15T19:38:45Z")

</div>

Hello everyone

Despite using Flash for a couple of years now I am still a relative newbie to Actionscript 2.0.

I have a button which controls the horizontal movement of a movie clip and next to it I have a button, if the user clicks the button once it moves up half way and when they click it again I would like for it to move up the rest of the way.

This script has been applied to the button

on (release) {  
if (xpos = 0) {  
trig.xposnew = -396;  
} else (xpos = -396){  
trig.xposnew = -627;  
}  
}

however when I click the button nothing happens

Thanking everyone in advance for their help

Cameron
