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

Maximum loops

New Here ,
Jul 19, 2007 Jul 19, 2007
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
1.3K
Translate
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 🙂
Translate
Guest
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 🙂
Translate
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
That worked perfectly! Thank you very much.
Translate
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

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?

Translate
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

@L Gryfe 

 

code is added to the actions panel.

 

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

Translate
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

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

Translate
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

as3 or html/canvas project?

Translate
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

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

Translate
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

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");

}

Translate
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

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). 

Translate
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
LATEST

you're welcome!  (and thanks for the follow up.)

Translate
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