# If else statements

**URL:** <https://forum.kirupa.com/t/if-else-statements/252860>\
**Category:** flash\
**Created:** [February 24, 2008, 3:06pm UTC](https://forum.kirupa.com/t/if-else-statements/252860 "2008-02-24T15:06:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaoss](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@kaoss](https://forum.kirupa.com/u/kaoss)\
**Post date:** [February 24, 2008, 3:06pm UTC](https://forum.kirupa.com/t/if-else-statements/252860/1 "2008-02-24T15:06:04Z")

</div>

lo all. im trying to remember an old bit of code i used to use but lost years ago. it may not even be used anymore or there may be a more efficient way of doin this but here goes:

it used the if or if else statements and a variable to give the buttons a kind of AI, so the movie knew where it was, what button was pressed and what frame to go to, it went something like:

if buttonpressed=button 1 gotoAndPlay frame 10  
else if button pressed=button2 gotoAndPlay frame 30  
and the buttons when pressed set the variable:  
on release button=button 1 etc.

as i say its a very old way of doing things but i liked it and would like to use it again, if i could remember it!

does this make sense to anybody, can anybody help?

thnx in advance.

kev.
