2 Replies Latest reply on Jan 26, 2015 8:08 AM by rezun8

    Google Adwords compatible flash banners for n00bs.

    leosapiens

      A small guide to a miserable evening of trying to make a google-adwords compatible banner in Flash CC by a miserable designer who is _not_ an actionscript pro. Or actionscript anything, really. Probably could be done smarter, but that's how I did it - with the help of the internet and some friends.


      Google adwords policy:

       

      https://support.google.com/adwordspolicy/answer/176108?hl=en

       

       

      The issues I had to deal with when publishing, the rest, so far, seem to be default in Flash CC:

       

      -----------

       


      Animation length must be 30 seconds or shorter


      Solved by looping the animation twice, or however is needed to have the length below 30s.

       

      Why 2 loops and not actually 30 seconds and then stop? So the banner won't freeze in the middle of the animation once reached 30 seconds.


      How it's done (step by step for utter actionscript noobs like myself):

      • Select an animation symbol instance (not in the library).
      • Go inside.
      • Add a new empty layer on top of all the other layers inside the symbol
      • Make a blank keyframe at the end of the animation sequence
      • Select it
      • Click F9 to call the Actions menu
      • Paste this code inside:

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

      if(this.loops_played >= 2) stop(); else play();

      this.loops_played++;

      • Repeat for every animation symbol + if there is animation out in timeline, there too. Can copy/paste the code layer.
      -----------
      AdWords currently supports only Adobe Flash Player versions 4 through 10.1. If your ad uses any other version (such as 10.2), it cannot be uploaded.

       

      Flash CC - for some obscure reason - is built to publish down to Flash 10.3, no less. It is solved by installing two files in the Flash directory:


      C:\Program Files\Adobe\Adobe Flash CC\Common\Configuration\Players\FlashPlayer9_0.xml

      C:\Program Files\Adobe\Adobe Flash CC\Common\Configuration\ActionScript 3.0\FP9\playerglobal.swc


      Files, courtesy of user kglad:

      https://forums.adobe.com/servlet/JiveServlet/download/5510986-147068/playerglobal.swc.zip

      https://forums.adobe.com/servlet/JiveServlet/download/5510986-147069/FlashPlayer9_0.xml


      How to use: After installing, go to File > Publish Settings, and select Flash Player 9.0 in "target" (top right corner) of the swf file format.

       

      -----------


      Google doesn't allow Flash ads that don't support the clickTAG variable. The clickTAG is the tracking code assigned by Google to an individual ad. It allows Google to register where the ad was displayed when it was clicked and helps advertisers determine the effectiveness of their campaign.


      Note that it's not necessary to specify the landing page URL for the ad anywhere in this code; this is taken care of through the usage of clickTAG.

      The code, provided by google for ActionScript 3:

      import flash.events.MouseEvent;
      import flash.net.URLRequest;
      // ......
      someButton_or_displayObject_to_receive_mouseClick.addEventListener(
         MouseEvent.CLICK,
         function(event: MouseEvent) : void {
           flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank");
           }
         );
      The blue text replaced with your instance name. Make sure that every instance of the button has the name.

      How it's done:
      • Find the animation symbol your button is sitting in and go inside.
      • Click on the button once.
      • See "Properties" (it's a tab next to "Library" for me).
      • Where it says <Instance Name> - write a name you like.
      • Make a new layer if there isn't one already for code. There probably is for the loop code beforehand.
      • Click F9 while on the first frame where the button appears.
      • Paste the above code.
      • Replace the blue text with the name you wrote.
      ----------------------------------
      And finally:
      • Publish.
      • Upload to Google Adwords to check if it bloody works.
      • ?
      • ?
      • PROFIT.

       

       

      If you think I got anything wrong, or you know a better way, let me know, this is all by trial and error, forum reading and a lot of frustration.

       

       

      Message was edited by: Dalia Kochnev

        • 1. Re: Google Adwords compatible flash banners for n00bs.
          rezun8 Level 4

          that is not the correct AS 3.0 ClickTAG function. Please use this instead.

           

          //######################################################################################## ############//

          //CLICK TAG

          //######################################################################################## ############//

          function handleClick(mouseEvent:MouseEvent):void {

              var interactiveObject:InteractiveObject = mouseEvent.target as InteractiveObject;

              var li:LoaderInfo = LoaderInfo(interactiveObject.root.loaderInfo);

              var url:String = li.parameters.clickTag;

              if (url) {

                  if (ExternalInterface.available) {

                      var userAgent:String = ExternalInterface.call('function(){ return navigator.userAgent; }');

           

           

                      if (userAgent.indexOf("MSIE") >= 0) {

                          ExternalInterface.call('window.open', url, '_blank');

                      } else {

                          navigateToURL(new URLRequest(url), '_blank');

                      }

                  } else {

                      navigateToURL(new URLRequest(url), '_blank');

                  }

              }

          }

          clickTag_btn.addEventListener(MouseEvent.MOUSE_UP,handleClick);

          //######################################################################################## ############//

           

           

           

          As well Google accepts up to Flash Player 11.2 as of Dec 2014.

          1 person found this helpful
          • 2. Re: Google Adwords compatible flash banners for n00bs.
            rezun8 Level 4

            forgot this, use this link to test your banner, if you click on the ad and you get the success page your good to go (code wise at least).

            DoubleClick Support

            1 person found this helpful