【问题标题】:How do I play the animation from the current frame, ActionScript 3.0如何从当前帧播放动画,ActionScript 3.0
【发布时间】:2013-04-03 21:33:55
【问题描述】:

我正在尝试为我的 Flash 动画制作个性化的暂停按钮。

这是我目前拥有的代码

var paused:Boolean = false;

pause.addEventListener(MouseEvent.CLICK, fl_PauseUnpause);

function fl_PauseUnpause(event:MouseEvent):void
{

  if(paused=true)
  {
    stop();
    paused=false;
  }

  else
  {
    gotoAndPlay(this.currentFrame);
    paused=true;
  }
}

停止动画效果很好,但之后不会重新开始。运行时不会报错。

【问题讨论】:

  • 提示:您可以使用play() 方法代替gotoAndPlay(currentFrame)
  • 还有你在第一个 if 语句中的关闭 { 是错误的,它应该是 }
  • 问题解决了!右括号只是一个复制错误。 play() 像宣传的那样工作,将 paused=true 更改为 paused==true 修复了语法错误。谢谢!

标签: actionscript-3 flash animation button


【解决方案1】:
if(paused=true) // this assigns true to paused and if always evaluates to true

一定是这样的:

if(paused==true) //or if(paused)

没有?

【讨论】:

    猜你喜欢
    • 2019-09-05
    • 1970-01-01
    • 2021-01-01
    • 1970-01-01
    • 2014-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多