# ::::URGENT::::how to prevent looping

**URL:** <https://forum.kirupa.com/t/urgent-how-to-prevent-looping/11999>\
**Category:** flash\
**Created:** [January 25, 2003, 12:55am UTC](https://forum.kirupa.com/t/urgent-how-to-prevent-looping/11999 "2003-01-25T00:55:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![squish](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@squish](https://forum.kirupa.com/u/squish)\
**Post date:** [January 25, 2003, 12:55am UTC](https://forum.kirupa.com/t/urgent-how-to-prevent-looping/11999/1 "2003-01-25T00:55:38Z")

</div>

i have a m/c (one) that moves with scripting. inside of that m/c is another m/c (two). two has a stop action on the first blank keyframe, and a stop action on 5th keyframe (ten frames) total.  
i can’t, for the life of me figger a way to play two when one reaches a specific \_x without looping.

//in two

onClipEvent(load) {  
x = \_root.one.\_x;  
}  
onClipEvent(enterFrame){  
if(x=100){  
this.gotoAndPlay(2);  
}  
}  
two seems to be looping i assume because the statement is always true. however i want two to play once (through 10 frames) then i would like to ‘reset’ the statement so if x=100 again it will play through two again.

any help would be greatly appreciated.

---

<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:** [January 25, 2003, 3:59am UTC](https://forum.kirupa.com/t/urgent-how-to-prevent-looping/11999/2 "2003-01-25T03:59:57Z")

</div>

onClipEvent(load) {  
x = \_root.one.\_x;  
}  
onClipEvent(enterFrame){  
if(x=100){  
this.gotoAndPlay(2);  
} else {  
stop();  
}

???

I may be wrong makes sense to me though.

---

<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:** [January 25, 2003, 4:02am UTC](https://forum.kirupa.com/t/urgent-how-to-prevent-looping/11999/3 "2003-01-25T04:02:48Z")

</div>

Well for one you will need a stop() action on the frame you want it to stop at.

And for two, when comparing to see if a variable equals something you must use the boolean value ==.

```auto
onClipEvent(load) {
x = _root.one._x;
}
onClipEvent(enterFrame){
if(x == 100){
this.gotoAndPlay(2);
}

```
