Adobe Animate canvas play() 不工作
Adobe Animate canvas play() not work
我在 canvas (html5) 上用 Adobe Animate CC 制作了横幅。我遇到了一个问题。
为什么 movieclip 代码中简单的 this.stop() 可以正常工作(就像好的旧 ActionScript),但 this.play() make error: 不是一个函数。卧槽?!
如何让我的时间轴停止并在我想要的时候播放动画?
完整代码如下:
this.stop()
window.setTimeout(go, 2000);
function go()
{
this.play();
}
问题是 "this"。这个函数内部不再引用主舞台影片剪辑 - 它引用函数。在函数前添加一行:
var that=this;
并将函数内的行更改为:
that.play();
:)
我在 canvas (html5) 上用 Adobe Animate CC 制作了横幅。我遇到了一个问题。
为什么 movieclip 代码中简单的 this.stop() 可以正常工作(就像好的旧 ActionScript),但 this.play() make error: 不是一个函数。卧槽?!
如何让我的时间轴停止并在我想要的时候播放动画?
完整代码如下:
this.stop()
window.setTimeout(go, 2000);
function go()
{
this.play();
}
问题是 "this"。这个函数内部不再引用主舞台影片剪辑 - 它引用函数。在函数前添加一行:
var that=this;
并将函数内的行更改为:
that.play();
:)