How can i wirte this in AS?

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 :slight_smile:

otherwise… any thoughts anyone? :ear: