# HELP: Little help on "if then" statement

**URL:** https://forum.kirupa.com/t/help-little-help-on-if-then-statement/64806
**Category:** flash
**Created:** [September 20, 2004, 9:38am UTC](https://forum.kirupa.com/t/help-little-help-on-if-then-statement/64806 "2004-09-20T09:38:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BUroKHUli](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/burokhuli/32/190_2.png) [@BUroKHUli](https://forum.kirupa.com/u/BUroKHUli)
#### Post date: [September 20, 2004, 9:38am UTC](https://forum.kirupa.com/t/help-little-help-on-if-then-statement/64806/1 "2004-09-20T09:38:51Z")

</div>

Hello again,

Supposing you have an movieclip nested on your main stage and you want that clip to move to a particular frame when a button is clicked, and if it has already moved to that specified frame, it will just PAUSE.

I was thinking of this:

* * *

if myClip = frame 5  
then gotoAndPlay(“label”);  
else  
gotoAndStop(currentFrame);

* * *

I tried to make the script but I get errors :). I’ve been looking for a TUT here at Kirupa but didn’t found one so far.

Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 20, 2004, 10:08am UTC](https://forum.kirupa.com/t/help-little-help-on-if-then-statement/64806/2 "2004-09-20T10:08:01Z")

</div>

just think that you want to move to 5th frame of root time line. the code would be

for button’s onPress event :

on(press){  
gotoAndStop(5);  
}  
thats all,

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 20, 2004, 10:09am UTC](https://forum.kirupa.com/t/help-little-help-on-if-then-statement/64806/3 "2004-09-20T10:09:00Z")

</div>

> [@BUroKHUli](#):
>
> Hello again,
> 
> Supposing you have an movieclip nested on your main stage and you want that clip to move to a particular frame when a button is clicked, and if it has already moved to that specified frame, it will just PAUSE.
> 
> I was thinking of this:
> 
> * * *
> 
> if myClip = frame 5  
> then gotoAndPlay(“label”);  
> else  
> gotoAndStop(currentFrame);
> 
> * * *
> 
> I tried to make the script but I get errors :). I’ve been looking for a TUT here at Kirupa but didn’t found one so far.
> 
> Thanks

Hi

Try using this:

if (myClip.\_currentframe == 5){  
gotoAndPlay(“label”);  
}else{  
gotoAndStop(currentFrame);  
}

* * *

aShIsH
