# Playing until Certain Frame

**URL:** <https://forum.kirupa.com/t/playing-until-certain-frame/298262>\
**Category:** flash\
**Created:** [October 15, 2009, 5:38pm UTC](https://forum.kirupa.com/t/playing-until-certain-frame/298262 "2009-10-15T17:38:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snobdr8](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@snobdr8](https://forum.kirupa.com/u/snobdr8)\
**Post date:** [October 15, 2009, 5:38pm UTC](https://forum.kirupa.com/t/playing-until-certain-frame/298262/1 "2009-10-15T17:38:00Z")

</div>

Hey everyone,

I was wondering if it’s possible to set up a listener that is triggered when a movieclip hits a certain frame number.

I was thinking it would go something like this:

myClip.addEventListener(Event.ENTERFRAME, frameListener);

function frameListener(e:event):void {  
if(myClip.currentFrame == 26){  
myClip.stop();  
myClip.removeEventListener(Event.ENTERFRAME, frameListener);  
}  
}

Any tips would be greatly appreciated!
