_currentframe and frame labels

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…

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