Adobe Edge: Add onComplete handler when animation finishes

谁说我不能喝 提交于 2019-12-24 07:44:52

问题


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 }         ]
  }
}

Thanks, in advance.


回答1:


In _edgeActions.js add the following:

Symbol.bindTimelineAction(compId, symbolName, "Default Timeline", "complete", function(sym, e) {
     alert('Timeline Complete');
}

or Open the code window (Window -> Code, or Ctrl +E).

Then, click on the "+" next to get Stage -> timeline -> complete and add your code there.



来源:https://stackoverflow.com/questions/12357216/adobe-edge-add-oncomplete-handler-when-animation-finishes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!