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

Creating a Flash Banner with Action Script 3

Community Beginner ,
Jul 07, 2017 Jul 07, 2017

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

TOPICS
ActionScript
6.9K
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

Advocate , Jul 08, 2017 Jul 08, 2017

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.

Translate
Community Beginner ,
Jul 08, 2017 Jul 08, 2017

It is still downloading, but meanwhile, after I import the new template into my file. Do I still need to keep the layer with the 1 point frame and leave the action script blank on the first frame needing the click tag? Is all of this in your template and I don't have to include this in the file? Sorry if these questions are very novice but that's exactly what I am with html5.

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
Advocate ,
Jul 08, 2017 Jul 08, 2017

The clickTag & border are both included in my template; you do not need to add them in Flash/Animate.

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 Beginner ,
Jul 08, 2017 Jul 08, 2017

Another question. Should I leave the layer with the ActionScript to stop at 3 loops.

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

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

It works. Or is this also included in your template?

I really appreciate all your help.

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
Advocate ,
Jul 08, 2017 Jul 08, 2017

The looping script is separate from the HTML template and should stay on the end frame of your banner.

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 Beginner ,
Jul 08, 2017 Jul 08, 2017

I imported your html template and published my file. When I open the file I get this. The banner doesn't work only this html text comes up.

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<meta name="authoring-tool" content="Adobe_Animate_CC">

<title>300x50_2</title>

<meta name="ad.size" content="width=300,height=50">

<style>

#canvas{

  -moz-user-select: none;

    -webkit-user-select: none;

    -ms-user-select: none;

    user-select: none;

  -webkit-tap-highlight-color: rgba(0,0,0,0);

  cursor: pointer;

}

</style>

<script src="https://s0.2mdn.net/ads/studio/cached_libs/createjs_2015.11.26_54e1c3722102182bb133912ad4442e19_min...."></script>

<script>var clickTag = "http://www.google.com";</script>

</head>

<body onload="init();" style="margin:0px;">

  <div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:300px; height:50px">

  <canvas id="canvas" width="300" height="50" style="position: absolute; display: block; background-color:rgba(255, 255, 255, 1.00);" onclick="javascript:window.open(window.clickTag)"></canvas>

  <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:300px; height:50px; position: absolute; left: 0px; top: 0px; display: block; border: 1px solid black; box-sizing:border-box;">

  </div>

  </div>

   

</body>

</html>

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
Advocate ,
Jul 08, 2017 Jul 08, 2017

It seems like you're still using an old version of Animate since a lot of the code from newer versions is missing.  If you go to Animate CC > About Animate, what version does it say you're using?

It should look like this if you're using the latest release:

Screen Shot 2017-07-08 at 4.12.03 PM.png

Depending on which version of Animate you're using, the template would have different requirements to function properly.

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 Beginner ,
Jul 08, 2017 Jul 08, 2017

Yes this is the version I am using. 2017.5

I tried it again and it worked. Thank you so much for all of your help. A million thank you's.

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 Beginner ,
Jul 08, 2017 Jul 08, 2017

Hi Emma,

One last question, does the website link to have to be in included in the html code or does the serving company do it on their end?

Thanks,

Anya

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
Advocate ,
Jul 09, 2017 Jul 09, 2017
LATEST

That part gets added in during trafficking.

All you need to give them is a zipped folder with your HTML, JavaScript, and images.  Do not include your source Fla file. 

You can test your banner here before sending out for trafficking to be sure there are no issues: HTML5 Validator

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
Advocate ,
Jul 08, 2017 Jul 08, 2017

That clickTag is for ActionScript 2.0, which isn't even supported anymore; Flash CS6 was the last version to support AS2. 

It seems like somebody is giving you very outdated specs. 

Can you find out what ad serving company will be trafficking your banners?  (For example: Adwords, DoubleClick, Sizmek, etc...)  Many companies handle HTML5 clickTags slightly differently.

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