# How To Cancelling this.onEnterFrame = function

**URL:** <https://forum.kirupa.com/t/how-to-cancelling-this-onenterframe-function/183614>\
**Category:** flash\
**Created:** [March 28, 2006, 9:20pm UTC](https://forum.kirupa.com/t/how-to-cancelling-this-onenterframe-function/183614 "2006-03-28T21:20:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesTaylor](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@JamesTaylor](https://forum.kirupa.com/u/JamesTaylor)\
**Post date:** [March 28, 2006, 9:20pm UTC](https://forum.kirupa.com/t/how-to-cancelling-this-onenterframe-function/183614/1 "2006-03-28T21:20:22Z")

</div>

this.onRelease = function() {  
this.\_x = (this.\_x+500);  
\_parent.InArrow.\_x = (\_parent.InArrow.\_x-300);  
this.onEnterFrame = function() {  
\_root.prevFrame();  
};  
};

Please bear with me, im new at all this!

this is the actionscript i have on a button nested within a couple of movie clips.

\_root.prevFrame makes my main timeline run back from frame 15 to frame 1. When the main time line hits 1 i need the

this.onEnterFrame = function() {  
\_root.prevFrame();

to be cancelled, but i can’t work out how to do it.

all help much appreciated. Attached is the swf of where i am so far, it should give you a better idea of why i need this to be cancelled.

---

<div class="post-metadata">

**Author:** ![serkios](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/serkios/32/608_2.png) [@serkios](https://forum.kirupa.com/u/serkios)\
**Post date:** [March 28, 2006, 9:25pm UTC](https://forum.kirupa.com/t/how-to-cancelling-this-onenterframe-function/183614/2 "2006-03-28T21:25:33Z")

</div>

do you mean…

```auto
delete this.onEnterFrame;

```

---

<div class="post-metadata">

**Author:** ![JamesTaylor](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@JamesTaylor](https://forum.kirupa.com/u/JamesTaylor)\
**Post date:** [March 28, 2006, 9:36pm UTC](https://forum.kirupa.com/t/how-to-cancelling-this-onenterframe-function/183614/3 "2006-03-28T21:36:22Z")

</div>

yes, but i need it to occur when the main timeline enters frame 1 (its running backwards at this point from frame 15 back to frame 1).

i just don’t seem to be able to get it to work,

i’ve tried putting this actionscript on the 1st frame of the main time line and mapping the command thro to the button MC and also tried putting actionscript on the button which says when main timeline enters frame 1 delete onEnterFrame but with no joy.

attached is the .fla as it stands, i’ve cleaned it back to working bits as it had become messy and confusing!

---

<div class="post-metadata">

**Author:** ![JamesTaylor](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@JamesTaylor](https://forum.kirupa.com/u/JamesTaylor)\
**Post date:** [March 28, 2006, 10:01pm UTC](https://forum.kirupa.com/t/how-to-cancelling-this-onenterframe-function/183614/4 "2006-03-28T22:01:38Z")

</div>

sorted!!!
