# An .onEnterFrame Question (AS MX)

**URL:** https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687
**Category:** flash
**Created:** [August 30, 2004, 4:44pm UTC](https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687 "2004-08-30T16:44:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![grappaFruit](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@grappaFruit](https://forum.kirupa.com/u/grappaFruit)
#### Post date: [August 30, 2004, 4:44pm UTC](https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687/1 "2004-08-30T16:44:27Z")

</div>

A simple topic i’m breaking my head about…

I’m creating a complex site, with lots of calculations, while I have to keep it as light as possible. I don’t want to have 50 [color=slategray].onEnterFrame[/color][color=black]'s[/color] running simultaniously, so, how do I stop them? See example:

Let’s say I want a simple movement, invoked by some reason:

```auto
 
 
mcChild.onEnterFrame = function(){
if(mcChild._x < mcParent._width){
mcChild._x += 5;
}
}

```

Now I want to stop the [color=slategray].onEnterFrame[/color] check, because it reached the [color=slategray]if = false[/color][color=black] - How??[/color]

Cheers

---

<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: [August 30, 2004, 4:46pm UTC](https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687/2 "2004-08-30T16:46:21Z")

</div>

delete this.onEnterFrame;

😛

---

<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: [August 30, 2004, 4:52pm UTC](https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687/3 "2004-08-30T16:52:57Z")

</div>

MWOAHAHAHAHAHAHA - Oh Dear, oh dear. The Simplicity, the stupidity…

I want those crazy pills of yours…

Cheers mate.

---

<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: [August 30, 2004, 5:22pm UTC](https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687/4 "2004-08-30T17:22:50Z")

</div>

lol, no worries. My first reaction was similar - “you can DO that?!?!” :lol:

We all go through it yo :hr:

---

<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: [August 30, 2004, 5:31pm UTC](https://forum.kirupa.com/t/an-onenterframe-question-as-mx/62687/5 "2004-08-30T17:31:03Z")

</div>

you can also do this:

\_root.onEnterFrame = null;

If you wanted to run a function as an onEnterFrame without using onEnterFrame within the function itself you could do this:

\_root.onEnterFrame = myFunction ();
