【发布时间】:2018-11-27 17:39:18
【问题描述】:
在 Adobe Animation for HTML5 Canvas 的文件输出中生成的 js 代码包含一个用于影片剪辑的对象,该对象包含要在每个帧中运行的代码。
(lib.cdseacc02_07 = function(mode,startPosition,loop) {
// timeline functions:
this.frame_0 = function() {
if(typeof showNarration !== "undefined"){ showNarration(1); }
}
this.frame_644 = function() {
playSound("02_07_01wav");
}
this.frame_652 = function() {
this.closeBtn_1.addEventListener("click", closepopup_1.bind(this));
}
this.frame_738 = function() {
this.stop();
}
}).prototype = p = new cjs.MovieClip();
如果从此代码对影片剪辑调用 gotoAndPlay,则帧函数上的代码不会在它们经过的帧上运行,此帧代码仅在第一次播放时间线时起作用。有什么方法可以让帧上的代码在每次播放头通过该帧时运行,即使它是通过代码中的 gotoAndPlay 调用?
【问题讨论】:
标签: html canvas createjs movieclip easeljs