You are here: Rich Media Foundry V3 > Preparing Flash for Click Tracking

Preparing Flash for Click Tracking

To properly track clicks with a flash ad, the original source file must be prepared to receive click-through parameters. This preparation is typically handled in the .fla by the flash developer.

Specific instructions for setting up the proper click-through parameters can be found for Flash versions 7-10 using ActionScript 2.0 and Flash versions 9 and 10 using ActionScript 3.0.

More information on flash development can be found in Adobe’s Developer Center at:

http://www.adobe.com/devnet/flash/

Before you begin, please note the following:

  1. If the whole file is meant to be clickable, a transparent button should be placed on the top layer of the SWF.
  2. In order to track clicks within 24/7 Open AdStream, the SWF must not be setup with a hardcoded click URL.

Set Up Steps for Flash 9-10 using ActionScript 3.0:

  1. Create a Button. If the button is not already on the stage, drag it to the stage.
  2. Give the button an instance name (myButton) on the stage
  3. Right click on the first key frame for the layer that contains the button (in the timeline pane). From the context menu, select "Actions" (this will open the Actions Frame for that layer).
  4. Place the click tag actionscript (listed below) in the Actions Frame

// ActionScript 3.0
/* Requires
* - Button symbol on Stage with instance name "myButton"
*/
myButton.addEventListener (MouseEvent.CLICK, buttonSymbol_click);


function buttonSymbol_click (evt:MouseEvent):void {
     var clickTAG:String = loaderInfo.parameters.clickTAG;
     // Check for malicious code injections, only use URLs if they begin with http: or https:
     if ((clickTAG.substr(0, 5) == "http:") || (clickTAG.substr(0, 6) == "https:"))
              {
              var req:URLRequest = new URLRequest(clickTAG);
              navigateToURL(req, "_blank");
              }
}

Set Up Steps for Flash 7-10 using ActionScript 2.0:

  1. A clickable flash object such as a button or “hitarea” in the flash movie clip will require some actionscript attached to it.
  2. Associate the on (release) event with that object.
  3. The object will now listen for that particular event. When the event occurs, it will trigger actionscript instructions.
  4. Place the click tag actionscript (listed below) as the instructions for the “on(release)” event

on (release)
{
   getURL (_root.clickTAG, "_blank");
  }

  1. Make sure to check off the "Expression" checkbox for the URL field that is the variable for the getURL actionscript function.

Related Topics: