Flash CS5 Actionscript 3.0 转到下一帧并播放代码

发布于 2024-10-25 03:37:58 字数 881 浏览 1 评论 0原文

我正在 Flash CS5 actionscript 3.0 中编写一个简单的电影时间线。除了“播放”按钮之外,我的所有按钮都可以工作,我想对其进行编码以表示“转到下一帧并播放”。这是我当前的动作脚本,任何人都可以帮助我找到正确的代码吗?

fastforwardBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(4025);
}

stop();

gotoStopBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
    gotoAndStop(1);
}


gotoPlayBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);

function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void
{
    gotoAndPlay(1);
}

stopBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame_2);

function fl_ClickToGoToNextFrame_2(event:MouseEvent):void
{
    nextFrame();
}

playBtn.on (release) ;{
_root.gotoAndPlay(_currentframe+1);
}

I am coding a simple movie timeline in Flash CS5 actionscript 3.0. I have all my buttons working except for the Play button which I would like to code to say "go to next frame and play". Here is my current actionscript can anyone help me to find the correct code?

fastforwardBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(4025);
}

stop();

gotoStopBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
    gotoAndStop(1);
}


gotoPlayBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);

function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void
{
    gotoAndPlay(1);
}

stopBtn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame_2);

function fl_ClickToGoToNextFrame_2(event:MouseEvent):void
{
    nextFrame();
}

playBtn.on (release) ;{
_root.gotoAndPlay(_currentframe+1);
}

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

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

发布评论

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

评论(1

烟柳画桥 2024-11-01 03:37:58
playBtn.addEventListener(MouseEvent.CLICK, fl_Click_Play);

function fl_Click_Play(event:MouseEvent):void
{
    MovieClip(root).play();
}

如果你有一个简单的fla,应该可以。如果这似乎不起作用,您可能需要这样的东西来定位正确的路径:

MovieClip(this.parent).play();

在不知道您的 fla 结构的情况下,它只是一个猜测;)

也 = _root 是 AS2,并且始终以 _level0 为目标。这在 AS3 中更改为“root”,并针对最顶层的 displayObjectContainer 的时间线。

playBtn.addEventListener(MouseEvent.CLICK, fl_Click_Play);

function fl_Click_Play(event:MouseEvent):void
{
    MovieClip(root).play();
}

should work, if you have a simple fla. And if that doesn't seem to work, you may need something like this to target the right path:

MovieClip(this.parent).play();

Without knowing your fla structure, its just a guess ;)

also = _root is AS2, and always targets _level0. This is changed in AS3 to just "root", and targets the timeline of the topmost displayObjectContainer.

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