# How can i wirte this in AS?

**URL:** <https://forum.kirupa.com/t/how-can-i-wirte-this-in-as/63738>\
**Category:** Uncategorized\
**Created:** [September 9, 2004, 4:48pm UTC](https://forum.kirupa.com/t/how-can-i-wirte-this-in-as/63738 "2004-09-09T16:48:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azazel](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Azazel](https://forum.kirupa.com/u/Azazel)\
**Post date:** [September 9, 2004, 4:48pm UTC](https://forum.kirupa.com/t/how-can-i-wirte-this-in-as/63738/1 "2004-09-09T16:48:39Z")

</div>

i want to make a “check function” on a button…

this is what i got so far

on (release){  
if(\_root.enter.level1.showgallery\_mc.\_currentframe == 10){  
\_root.enter.level1.showgallery\_mc.gotoAndPlay(“10”)[COLOR=Red] then go to and play \_root.gotoAndPlay(“19”); (this is the part i don’t know how to write in AS. I want it to say "if executed on this button go to frame 19 in root efter having played frames from frame 10. Because i want diffrent buttons to go back to a diffrent frame in the root timeline so i can’t just ad the gotoAndPlay(“19”) at the end of the first animation.)[/COLOR]  
}else{  
\_root.enter.level1.gotoAndPlay(“19”);  
}  
}

If you don’t understand (cause it’s a bit meassy…) just post what i’m not making clear enough 🙂

otherwise… any thoughts anyone? :ear:
