# \_currentframe and frame labels

**URL:** <https://forum.kirupa.com/t/-currentframe-and-frame-labels/11744>\
**Category:** flash\
**Created:** [January 21, 2003, 7:20pm UTC](https://forum.kirupa.com/t/-currentframe-and-frame-labels/11744 "2003-01-21T19:20:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phorte](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@phorte](https://forum.kirupa.com/u/phorte)\
**Post date:** [January 21, 2003, 7:20pm UTC](https://forum.kirupa.com/t/-currentframe-and-frame-labels/11744/1 "2003-01-21T19:20:13Z")

</div>

Is it possible to regognise a \_currentframe by a frame label. As in if you had a script like this

- 

if (\_root.\_currentframe=5) {  
\_root.blah.\_visible=false  
}  
\*

And if frame 5 had a frame label that was “Blah”… could you refer to frame 5 by the frame label… I think the script should be…

- 

if (\_root.\_currentframe=“blah”) {  
\_root.blah.\_visible=false  
}  
\*

but it doesnt seem to work… any one else know if you can do this…

---

<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:** [January 21, 2003, 7:54pm UTC](https://forum.kirupa.com/t/-currentframe-and-frame-labels/11744/2 "2003-01-21T19:54:59Z")

</div>

you cant check for frame lables since \_currentframe only represents the frame number of the current frame. Frame labels only help you manage your navigation with the use of gotoAndPlay/Stop.

However, as a workaround, you can do the following:

thisFrame = \_root.\_currentframe;  
\_root.gotoAndStop(“blah”);  
if (\_root.\_currentframe **==** thisFrame) {  
\_root.blah.\_visible=false  
}  
gotoAndPlay(thisFrame);

What this does is saves the actual \_currentframe in the variable thisFrame, then goes to the label you want to check. Then it compares the new \_currentframe with our old frame in thisFrame. If they are the same then the playhead didnt move and you are in fact on the frame with that label. The final gotoAndPlay returns you to the actual current frame as stored in thisFrame
