Skip to main content
Known Participant
July 7, 2017
Answered

Creating a Flash Banner with Action Script 3

  • July 7, 2017
  • 1 reply
  • 8852 views

Hi there,

I have created an animated flash banner, and typically they need to stop after 3 loops. I have tried everything. Please advise if anyone knows how to make my animation stop after 3 loops. What should the action script be on the first frame and the last frame.

Thank you,

Anya

This topic has been closed for replies.
Correct answer just.emma

I will post the new html code when I have downloaded the lastest version of Flash 2017. I hope by opening my old file in the latest version of flash will generate the new code that will work?


If you have access to Animate CC 2017, you should just import my template which I posted earlier: Re: Creating a Flash Banner with Action Script 3

In Animate CC 2017, just go to Publish Settings > Advanced > Import New and import the template.  You will not need to edit the HTML file; once you import the template, you can just republish your banner and it will have everything you need.

1 reply

just.emma
Inspiring
July 8, 2017

None of the major ad serving companies even accept Flash banners anymore, so you should really consider switching to HTML5.

The code would actually be the same in both AS3 and JavaScript (for HTML5 Canvas mode in Animate CC).  Just add this to the end frame of your banner:

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

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

Known Participant
July 8, 2017

Thank you so much for your help that worked. I switched to HTML5 Canvas mode in Flash.

They ask for a click tag to be added with a stroke around the ad, they provided the following code.

on (release) {getURL(_level0.clickTag, "_blank");}

I created a new layer and added this on the first frame, then my ad doesn't work. Any ideas?

Known Participant
July 8, 2017

By the way, the issue with hosting the libraries locally is that it's going to make the file size way higher.  I strongly recommend upgrading to a newer version of Animate CC if at all possible, so you can use the Google-hosted version as well as all kinds of other improvements.

Otherwise, you might just have to do a static JPG or GIF banner depending on the file size limits that you're working with.


I will post the new html code when I have downloaded the lastest version of Flash 2017. I hope by opening my old file in the latest version of flash will generate the new code that will work?