Flash Files

Flash Versions: Up through Flash 9 (actionscript 2.0)

Click Tracking:

The author of the Flash source file (.fla) has to assign a clickTAG variable using a getURL button action. They also have to make sure that they have selected _blank for a target so it opens in a new window.

The button action code should look like one of these 3 examples:

1.

on (release) {

getURL(clickTAG,”_blank”)

}

2.

on (release) {

getURL(_level0.clickTAG,”_blank”)

}

3. on (release) {

if (clickTAG.substr(0,5) == “http:”) {

getURL(clickTAG,”_blank”)

}

Example Action Script 2.0

Flash Versions: Flash 9 and 10 (Actionscript 3.0)

Click Tracking:

The author of the Flash source file (.fla) has to assign a clickTAG variable using a getURL button action. They also have to make sure that they have selected _blank for a target so it opens in a new window.

The button action code should look like the following:

// 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”);

}

}

Action Script 3.0 Example

A helpful Flash link:

Building Macromedia Flash Banners with Tracking Capabilities

http://www.macromedia.com/resources/richmedia/tracking/designers_guide/