在 Flash CS3 和 Action Script 3 中输入转到下一帧的键

发布于 2024-10-05 12:53:47 字数 141 浏览 0 评论 0原文

在 Flash CS3 中,我有三个帧,当我从第一帧按 Enter 键时,它会转到下一帧。但我想在我的项目中停止这种情况。就像当用户在第一帧中按 Enter 键时,它不应该转到第二帧。如何使用 Flash CS3 在 Action Script 3.0 中执行此操作?

In flash CS3 i have three frames and when i press enter from frame one it goes to next frame. But i want to stop that in my project. Like when user press enter key in the frame one it should not go to frame 2. How to do this in Action Script 3.0 using Flash CS3?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

十秒萌定你 2024-10-12 12:53:47

这是真的在发布的 SWF 中还是仅在 Flash IDE 中?在 Flash 中按 ENTER 键即可播放时间线。

仅当您在 Flash 中查看 SWF 时按 Enter 键时才会发生这种情况。尝试在文件系统中打开它。

alt text

如果没有,您应该查看 KeyboardEvents:

stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler);

private function onKeyUpHandler(event : KeyboardEvent) : void
{
    switch(event.keyCode)
    {
        case Keyboard.ENTER:
            nextFrame();
            break;
    }
}

Is this really in the published SWF or just in the Flash IDE? Hitting the ENTER key in Flash plays the timeline.

This happens only when you hit ENTER while looking at the SWF in Flash. Try opening it in the file system.

alt text

If not you should look into KeyboardEvents:

stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler);

private function onKeyUpHandler(event : KeyboardEvent) : void
{
    switch(event.keyCode)
    {
        case Keyboard.ENTER:
            nextFrame();
            break;
    }
}
固执像三岁 2024-10-12 12:53:47

当你测试你的电影时。不要只点击 cmd-enter,而是点击 cmd-f12,这将在浏览器中对其进行测试,这将消除 Flash 的默认 Enter 键功能。

When you test your movie. Instead of just hitting cmd-enter, hit cmd-f12 this will test it in a browser which will eliminate flash's default enter key functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文