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

Loop Animate CC timeline X times and stop

New Here ,
Jun 09, 2016 Jun 09, 2016

Copy link to clipboard

Copied

I'm trying to loop the timeline a few times and stop. All the help files I have found so far do not work. Anyone have any ideas?

TOPICS
How to

Views

29.3K

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
Enthusiast ,
Jun 09, 2016 Jun 09, 2016

Copy link to clipboard

Copied

Another time, try to search forum

Put this code on last frame. This is sample for 3 loops.

if(!this.alreadyExecuted){

this.alreadyExecuted=true;

this.loopNum=1;

} else {

this.loopNum++;

if(this.loopNum==3){

this.stop();

}

}

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 ,
Jun 09, 2016 Jun 09, 2016

Copy link to clipboard

Copied

You can do it in a lot less code than that:

  1. if (!this.looped) this.looped = 1
  2. if (this.looped++ > 3) this.stop(); 

Put the code wherever you want it to stop, set the 3 to the desired loops.

Strange how often this specific simple question comes up.

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
Advocate ,
Jun 09, 2016 Jun 09, 2016

Copy link to clipboard

Copied

I mentioned this in another thread with the same subject but I'll add it here as well... that code is more concise but I would change it to:

if (!this.looped) this.looped = 1;

if (this.looped++ == 3) this.stop();

(== instead of >) so that it stops at exactly at a specific number of loops.  Your example loops 4 times instead of 3.

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 ,
Jun 09, 2016 Jun 09, 2016

Copy link to clipboard

Copied

And as I responded last time, that depends on whether you put the code at the beginning or end of the main timeline.

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
Advocate ,
Jun 09, 2016 Jun 09, 2016

Copy link to clipboard

Copied

It doesn't really seem logical to put it at the beginning of the timeline.

Typically when you loop something, you would want to stop on the end frame with something interesting to look at, some kind of message, or a call to action; not go back to a blank beginning frame before the animation started.

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 ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

Does this work for HTML 5 export?

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 ,
May 19, 2021 May 19, 2021

Copy link to clipboard

Copied

Just try it in HTML 5 export work greats, thx ! 🙂

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 Beginner ,
Oct 07, 2022 Oct 07, 2022

Copy link to clipboard

Copied

Tried this several times with no success — the file just stops and shows random elements of the file, never loops. 

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 Beginner ,
Oct 07, 2022 Oct 07, 2022

Copy link to clipboard

Copied

Any pointers? 

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 ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

I've been using these above codes in previous banners. Now neither of the codes are working. Aaargh! Stupid update.
Have anyone figured out what to do instead?..   I miss Flash. 

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 ,
Nov 17, 2022 Nov 17, 2022

Copy link to clipboard

Copied

LATEST

Already figured it out. I have accidently checked off "Loop Timeline" in Publish Settings. The code is working again. For anyone who might experience the same problem 🙂

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