# \[help\] if then statement

**URL:** <https://forum.kirupa.com/t/help-if-then-statement/26812>\
**Category:** flash\
**Created:** [July 26, 2003, 6:40pm UTC](https://forum.kirupa.com/t/help-if-then-statement/26812 "2003-07-26T18:40:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yeldarb](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yeldarb](https://forum.kirupa.com/u/Yeldarb)\
**Post date:** [July 26, 2003, 6:40pm UTC](https://forum.kirupa.com/t/help-if-then-statement/26812/1 "2003-07-26T18:40:13Z")

</div>

[AS]if (\_root.score==“5000”) {  
this.nextFrame();  
}  
[/AS]  
i don’t know why this doesn’t work…  
can someone help me plz?  
i know that the variable gets up to 5000, because the score box (dynamic text) reads out 5000 when you hit the last block, this is supposed to take it to the next frame, which contains the next level.  
thank you!

---

<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:** [July 26, 2003, 6:42pm UTC](https://forum.kirupa.com/t/help-if-then-statement/26812/2 "2003-07-26T18:42:53Z")

</div>

the code above only executes once, when the movie is loaded. You need to have that inside an onEnterFrame event:

```auto
myClip.onEnterFrame = function() {
if (_root.score=="5000") {
        this.nextFrame();
}
}

```

---

<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:** [July 26, 2003, 6:45pm UTC](https://forum.kirupa.com/t/help-if-then-statement/26812/3 "2003-07-26T18:45:18Z")

</div>

oh, i see, thanks  
i tried an onClipEvent(enterframe), but it said it could only be used on movie clips  
thanks for the help, i definitely learned something 🙂
