# How to get the current frame?

**URL:** <https://forum.kirupa.com/t/how-to-get-the-current-frame/289169>\
**Category:** flash\
**Created:** [May 27, 2009, 4:37am UTC](https://forum.kirupa.com/t/how-to-get-the-current-frame/289169 "2009-05-27T04:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadaj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kadaj/32/9061_2.png) [@kadaj](https://forum.kirupa.com/u/kadaj)\
**Post date:** [May 27, 2009, 4:37am UTC](https://forum.kirupa.com/t/how-to-get-the-current-frame/289169/1 "2009-05-27T04:37:00Z")

</div>

How to get the current frame?

At first its in the starting frame.  
What I want to do is when I press Enter gotoAndStop(3);  
and again pressing enter key and if its in frame 5 gotoAndStop(5); etc.

So how to know which frame I’m in at the present moment?

One way I did is giving all the keyframes (3, 5, etc) a particular label  
and check using ‘currentLabel == 3 ,…etc’. But is there any way to do it without giving it a label by merely using the keyframe numbers?

why does trace(this.frame); returns ‘undefined’?

Please help.  
Thank You.
