本文介绍了Adobe Edge:动画结束时添加onComplete处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用最新版本的Adobe Edge。我有一个简单的5张图片动画。我希望能够在第五张图片完成动画处理后执行自定义功能。如何才能做到这一点?我尝试将完整的函数调用添加到以下位置(**),但均无效。
I am using the latest version of Adobe Edge. I have a simple 5 image animation. I would like to be able to execute a custom function when the 5th image is done its animation. How can this be done? I have tried adding a complete function call to the following places (**), but neither works.
timelines: {
"Default Timeline": {
fromState: "Base State",
toState: "",
duration: 5500,
autoPlay: true,
**complete:function(){alert('hello world')},**
timeline: [
{ id: "eid23", tween: [ "style", "${__5}", "opacity", '1', { fromValue: '0.000000'}], position: 3986, duration: 1514,**complete:function(){alert('hello world')}}**,
{ id: "eid18", tween: [ "style", "${__4}", "opacity", '1', { fromValue: '0.000000'}], position: 3000, duration: 1500 },
{ id: "eid4", tween: [ "style", "${__1}", "opacity", '0.000000', { fromValue: '1'}], position: 0, duration: 1500 },
{ id: "eid13", tween: [ "style", "${__3}", "opacity", '1', { fromValue: '0.000000'}], position: 2015, duration: 1485 },
{ id: "eid9", tween: [ "style", "${__2}", "opacity", '1', { fromValue: '0.000000'}], position: 1005, duration: 1495 } ]
}
}
谢谢。
推荐答案
在_edgeActions.js中添加以下内容:
In _edgeActions.js add the following:
Symbol.bindTimelineAction(compId, symbolName, "Default Timeline", "complete", function(sym, e) {
alert('Timeline Complete');
}
或打开代码窗口(Window-> Code或Ctrl + E)
or Open the code window (Window -> Code, or Ctrl +E).
然后,单击 +以获取Stage-> timeline-> complete并在其中添加代码。
Then, click on the "+" next to get Stage -> timeline -> complete and add your code there.
这篇关于Adobe Edge:动画结束时添加onComplete处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!