Highlighted

How to Stop an HTML5 animation after three loops?

Explorer ,
Oct 26, 2019

Copy link to clipboard

Copied

Hi, I'm relatively new to Animate for HTML5 Banner ad production. 

I have a 10 second timeline. My limit for my final banner ad is 30 seconds then it needs to freeze. So, three loops. I've watched a number of tutorials but none seem to cover this that I've found.

 

Is there a good way to control an animation so it doesnt exceed the allotted looping requirement?

 

Thanks!

Put this code at the end of 10 second timeline

 

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

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

TOPICS
Ad development, How to, Import and export

Views

207

Likes

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

How to Stop an HTML5 animation after three loops?

Explorer ,
Oct 26, 2019

Copy link to clipboard

Copied

Hi, I'm relatively new to Animate for HTML5 Banner ad production. 

I have a 10 second timeline. My limit for my final banner ad is 30 seconds then it needs to freeze. So, three loops. I've watched a number of tutorials but none seem to cover this that I've found.

 

Is there a good way to control an animation so it doesnt exceed the allotted looping requirement?

 

Thanks!

Put this code at the end of 10 second timeline

 

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

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

TOPICS
Ad development, How to, Import and export

Views

208

Likes

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
Oct 26, 2019 0
Participant ,
Oct 27, 2019

Copy link to clipboard

Copied

There was a fairly similar thread recently about looping an HTML5 animation a fixed number of times.  I'd suggest you have a look at that and look at the example files provided by the Adobe Community Expert who responded (resdesign): https://community.adobe.com/t5/Animate/At-a-loss-How-do-I-get-my-animation-to-loop-a-set-number-of/m...

 

In essence, you need to set a counter in code for the number of required loops then do an if/else statement to check if another loop needs to run (or else stop).

Likes

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
Reply
Loading...
Oct 27, 2019 0
Enthusiast ,
Oct 27, 2019

Copy link to clipboard

Copied

Put this code at the end of 10 second timeline

 

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

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

Likes

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
Reply
Loading...
Oct 27, 2019 2
Explorer ,
Oct 27, 2019

Copy link to clipboard

Copied

@marjantrajkovski, CBLIVI,

Thank you so much.

 

The code at the end of the timeline above worked perfectly. Thank you!

Likes

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
Reply
Loading...
Oct 27, 2019 0