Flash 是否可以访问Actionscript 2.0中框架的NAME属性?

Flash 是否可以访问Actionscript 2.0中框架的NAME属性?,flash,actionscript,actionscript-2,cs4,Flash,Actionscript,Actionscript 2,Cs4,我将第50帧命名为\u foo(在IDE中) 我可以在任何时候追踪这个。_currentFrame(并获得一个数字) 我可以gotoAndPlay(“\u foo”) 但是我如何才能在电影播放时确定当前帧是否为\u foo 这可能吗?在ActionScript 2中,无法访问当前帧的名称/标签(此功能是在ActionScript 3中添加的) 但是,可以使用以下代码在播放期间确定当前帧编号: // This is the frame number we want to look out for.

我将第50帧命名为
\u foo
(在IDE中)

我可以在任何时候追踪这个。_currentFrame(并获得一个数字)

我可以
gotoAndPlay(“\u foo”)

但是我如何才能在电影播放时确定当前帧是否为
\u foo


这可能吗?

在ActionScript 2中,无法访问当前帧的名称/标签(此功能是在ActionScript 3中添加的)

但是,可以使用以下代码在播放期间确定当前帧编号:

// This is the frame number we want to look out for.
var targetFrame : Number = 50;

// Crate an onEnterFrame function callback, this will be
// called each time the current MovieClip changes from one
// frame to the Next.
onEnterFrame = onEnterFrameHandler;

/**
 * This function is called each time the MovieClip enter a 
 * new frame during playback.
 */
function onEnterFrameHandler() : Void
{
    trace("_currentframe: " + _currentframe);
    if (_currentframe == targetFrame)
    {
        trace("Playhead is at Frame: " + _currentframe);

        // Stop playback and remove the onEnterFrame callback.
        stop();
        onEnterFrame = null;
    }
}

为了进一步阅读,请务必检查Adobe livedocs条目中的

是的,不幸的是,在这种情况下,帧编号对我来说是无用的。然而,我只是创建自己的属性,名为_frameName,并在适当的帧处为它赋值,然后测试它是否为onEnterFrame时的值。同样有效。