# If statement help

**URL:** <https://forum.kirupa.com/t/if-statement-help/214669>\
**Category:** Uncategorized\
**Created:** [January 31, 2007, 12:16am UTC](https://forum.kirupa.com/t/if-statement-help/214669 "2007-01-31T00:16:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdudlik](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mdudlik/32/3143_2.png) [@mdudlik](https://forum.kirupa.com/u/mdudlik)\
**Post date:** [January 31, 2007, 12:16am UTC](https://forum.kirupa.com/t/if-statement-help/214669/1 "2007-01-31T00:16:38Z")

</div>

I need an if statement to act based on the button pressed

if (BUTTONPRESSED == BUTTONNAME) {  
gotoandplay(“label1”)  
gotoandplay(“label2”)  
gotoandplay(“label3”)

}

please help me format the syntax for this? i dont know how to do it so that  
it acts based on the button instance.

also…i dont know how to have it play a certain number of frames,  
before skipping to the next gotoandplay from the if statement.

please help!  
thank you thank you!
