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

Maximum loops

New Here ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

Hi, I am doing a web ad for a site and they stipulate that the flash file can only loop 3 times max. How do I do this? I am a designer who is very limited in my action scripting knowledge so any help would be greatly appreciated.
TOPICS
ActionScript

Views

983

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

Deleted User
Jul 19, 2007 Jul 19, 2007
on the last frame of your animation (where you want your ad to stop), put the following code

if (loopCount == undefined) loopCount = 0;
if (++loopCount == 3) stop();

i think 🙂

Votes

Translate

Translate
Guest
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

on the last frame of your animation (where you want your ad to stop), put the following code

if (loopCount == undefined) loopCount = 0;
if (++loopCount == 3) stop();

i think 🙂

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 ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

That worked perfectly! Thank you very much.

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
Contributor ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

Where exactly to you insert this code? I'm very new to Adobe Animate. What should I select and which panel do I insert this code into?

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 ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

@L Gryfe 

 

code is added to the actions panel.

 

(and you'll need to use as3, not as2 from 15 years ago.)

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
Contributor ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

Wow! Thanks for the quick reply! I saw this was a very old thread. I wasn't even sure if anybody was following it anymore. Yes, I'm using the latest version of Adobe Animate.

 

I found the actions panel. Can I apply this to any last frame? It's a banner ad, so I chose the last animation frame of the frame that surrounds the artwork (a little confusing that they’re both frames). When I copied and pasted the code into the Actions panel, it appeared under the Scene 1 at “frame: Frame 198”. After that, I tested the movie with the Publish settings with the Loop on and the off but there was no change. Loop off still only runs once and Loop on runs forever. I must be missing something. Please advise.

 

LG

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 ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

as3 or html/canvas project?

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
Contributor ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

html/canvas, I believe. I need to supply it to a newspaper as an banner ad for their online publication.

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 ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

label the first frame of the loop startframe, and add to the end frame of the loop actions panel:

 

if(!this.playCount){
this.playCount=1;

} else {
this.playCount++;

}

if(this.playCount==3){
this.stop()

} else {
this.gotoAndPlay("startframe");

}

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
Contributor ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

OMG! It worked! Thank you. Thank you. Thank you. I had to Google how to label a frame, but that's okay! Have a great evening (or whatever time of day it is where you are). 

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 ,
Dec 04, 2022 Dec 04, 2022

Copy link to clipboard

Copied

LATEST

you're welcome!  (and thanks for the follow 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