ActionScript3的。屏幕自动更改一段时间后

时间:2014-08-18 07:53:03

标签: actionscript-3 frame keycode

我是AS3中的新手,在编码暂停和取消暂停时卡住了。 在第20帧

    stage.frameRate=0;
    stage.addEventListener(KeyboardEvent.KEY_UP, wait);
function wait(event:KeyboardEvent)
{
        if(event.keyCode == 40)
        {
            //Resume pause by return framerate = 20
            stage.frameRate = 20;
            event.currentTarget.removeEventListener(KeyboardEvent.KEY_UP,wait);
        }
}

我不知道为什么在等待大约10秒后,此屏幕包含此代码自动更改为第21帧

1 个答案:

答案 0 :(得分:0)

frameRate的值

Adob​​e帮助提及0 can't be the frameRate's value

Valid range for the frame rate is from 0.01 to 1000 frames per second.

这意味着对于frameRate的值为0.01,您的Flash电影将在100秒后播放。

<强> gotoAndStop()

舞台frameRate属性不是为了在一帧中停止你的电影,而是为了获取和设置舞台的帧速率。

如果你想要stop你的Flash电影和等待第20帧:

gotoAndStop(20);

如果你想要play

play();