# ENTER\_FRAME issue

**URL:** <https://forum.kirupa.com/t/enter-frame-issue/261755>\
**Category:** flash\
**Created:** [May 30, 2008, 2:44pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755 "2008-05-30T14:44:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![atjkan](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@atjkan](https://forum.kirupa.com/u/atjkan)\
**Post date:** [May 30, 2008, 2:44pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/1 "2008-05-30T14:44:30Z")

</div>

Hi guys, I’m really quite new to actionscript let alone AS3, hopefully you can help me out with an issue I’m having.

I have a movieclip with instance name “Title” within my main timeline. I want to jump to a frame within “Title” labelled “Appear” whenever the playhead reaches a certain frame on the main timeline.

In AS2 I would have gone with onEnterFrame, but I’m not sure what to do with AS3. Here’s what I’ve attempted, but it doesn’t seem to work:

```auto
 
addEventListener(Event.ENTER_FRAME,myFunction);
function myFunction(event:Event) {
trace("MovieClip(root).Title.gotoAndPlay(Appear)");
}
removeEventListener(Event.ENTER_FRAME,myFunction);

```

Any help you could give would be great.

Thanks!

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 30, 2008, 3:03pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/2 "2008-05-30T15:03:14Z")

</div>

Just stick the removeEnterFrameListener inside your function

```auto

addEventListener (Event.ENTER_FRAME,myFunction);
function myFunction (event:Event) {
	trace ("MovieClip(root).Title.gotoAndPlay(Appear)");
	removeEventListener (Event.ENTER_FRAME,myFunction);
}

```

---

<div class="post-metadata">

**Author:** ![atjkan](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@atjkan](https://forum.kirupa.com/u/atjkan)\
**Post date:** [May 30, 2008, 3:17pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/3 "2008-05-30T15:17:13Z")

</div>

Thanks for the suggestion, still not seeing anything happening. Does the removeEventListener stop the movieclip playing?

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [May 30, 2008, 3:19pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/4 "2008-05-30T15:19:10Z")

</div>

Why is the enterFrame event needed? By the description it sounds like you just need a goto command in a location in the main timeline

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 30, 2008, 3:19pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/5 "2008-05-30T15:19:27Z")

</div>

The removeEventListener will just stop calling the function. I just tested it briefly, I just added that code to the first frame of my time line and “MovieClip(root).Title.gotoAndPlay(Appear)” traced once.

You have a small demo I can see?

edit: that’s true sen…

---

<div class="post-metadata">

**Author:** ![atjkan](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@atjkan](https://forum.kirupa.com/u/atjkan)\
**Post date:** [May 30, 2008, 3:25pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/6 "2008-05-30T15:25:14Z")

</div>

Ah you’re so right! Thanks that makes life a whole lot simpler! That’s it working now.

🙂

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [May 30, 2008, 3:52pm UTC](https://forum.kirupa.com/t/enter-frame-issue/261755/7 "2008-05-30T15:52:52Z")

</div>

![](http://forum.kirupa.com/uploads/kirupa/6905/270c0766933a9c56.gif)
