• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Timeline complete event

New Here ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

Hi,

Within the HTML file generated by publishing a HTML5 Canvas animation, how can I create a function that's triggered when the main timeline animation is complete? I've found Adobe Edge references like that below:

AdobeEdge.Symbol.bindTimelineAction(compId, "stage", "Default Timeline", "complete", function(sym, e) { console.log('timeline complete'); });

But how do I perform such actions within the HTML file generated by Adobe Animate CC 2017?

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 27, 2017 Apr 27, 2017

the easiest way is to place a function call on the last frame of the main timeline.

another way would be to use a tick loop to repeatedly compare the currentFrame and totalFrames.

Votes

Translate

Translate
Community Expert ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

the easiest way is to place a function call on the last frame of the main timeline.

another way would be to use a tick loop to repeatedly compare the currentFrame and totalFrames.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

Curiously, the only event the Timeline class supports is "change". You'd think there would be a "complete" and/or "loop" event. Maybe if enough people asked for it they'd add it. Wouldn't take much effort.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

i don't think the change event works the way someone coming from a flash/animate background would think.  i believe it's triggered when the timeline is shortened or lengthened, not when the timeline changes from one frame to another.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

Timeline durations in Flash/Animate aren't mutable at runtime, so that wouldn't even make sense.

TweenJS v0.6.2 API Documentation : Timeline

Events

change

  

  Defined in  change:186 

Available since 0.5.0

Called whenever the timeline's position changes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

you're correct.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

There's nothing like the detailed Edge Animate API anymore?

Adobe Edge Animate CC JavaScript API

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

Of course there still is... in Edge Animate.

Animate CC in Canvas mode uses the CreateJS API.

CreateJS | A suite of JavaScript libraries and tools designed for working with HTML5

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2017 Apr 27, 2017

Copy link to clipboard

Copied

LATEST

Thanks all, for my purposes the main timelines change event appears suitable.

mainTimeline = stage.children[0].timeline;

mainTimeline.addEventListener("change", onAnimatingMainTimeline);

function onAnimatingMainTimeline () {

     if (mainTimeline.position == mainTimeline.duration) {

          console.log("animation complete");

     }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines