clickTAG and Loop Limit for Flash Creative ActionScript 3
In this video tutorial I’m showing how to assign a clickTAG and loop limit to Adobe Flash creative banner / display ads under ActionScript 3. A clickTAG can be modified somewhat depending on specific ad servers, so this tutorial is for WTWH Media ad server specification, but should apply generally for most cases.
What is a clickTAG? The very short story is its a piece of code that tells an ad server that it (the ad itself) was clicked – so its simply a way to track clicks with Flash files. When creative is loaded into an ad server, and then that creative is displayed on a website, a clickTAG ensures that a Flash file registers clicks and sends user to the correct URL. With Flash files no URL is coded to the creative. The URL is provided to us separately to load with the Flash files. The clickTAG then references the URL provided and sends the user along to the correct destination.
A loop limit is a way to tell the Flash file to run through its course, but to then stop animating after X times. We have a loop limit requirement of 3X, so that means the ad should start, run through the creative, return to start and do that no more than three times before stopping on a final frame for display. This is generally to keep visual noise lower on our network of sites, but to also encourage quick clean calls-to-action from our advertisers for best results if using animated / looping creative.
In Flash you can set your ActionScript to different versions of the code for your project. A common mistake is later versions of Adobe Flash are set to ActionScript 3 and clickTAG methods for ActionScript 2 are implemented. You can set code to version 2 in later version and use the older method for adding in the clickTAG properly. If your looking for the tutorial on clickTAG for ActionScript 2, you can find that here.
Here is the clickTAG code for ActionScript 3:
import flash.events.MouseEvent; import flash.net.URLRequest; buttonOrObject.addEventListener( MouseEvent.CLICK, function(event: MouseEvent) : void { flash.net.navigateToURL(new URLRequest( root.loaderInfo.parameters.clickTAG), "_blank"); } );
Here is the Loop Limit code used for this video tutorial:
if(!this.loops_played) this.loops_played = 1; if(this.loops_played >= 4) gotoAndStop(); else play();
and use this for last frame for Loop Limit:
this.loops_played++;
——–Video Here
This works for me until I add the clickTAG code. After I add it, the loop continues and doesn’t stop after 3. I’ve repeated the tutorial 3-4 times with a new document and can’t figure out what I’m missing. Any suggestions? I’m using CS5, Actionscript 3.
Be sure clickTAG is assigned to the object separate from the script layer that contains the loop limit.