Click through, Multiple Clicks and Forms

Last modified on August 17, 2011 | print

Download template here

Click through

  • Most banners ads click through to a landing page to give the user more information about the advertiser’s product/services. This is achieved by creating a button in your Flash creative. The ActionScript attached to the frame, which let’s say has the instance name myButton, must always look like this (NB the button called “myButton” need to be already present at the same time on the timeline):
myButton.onRelease = function () {
    var a = _root.clickTAG.toLowerCase();
    if (a.indexOf("http://") == 0 || a.indexOf("https://") == 0){
        getURL(_root.clickTAG, "_blank");
    }
};
  • The above script should not be modified in any way and be used verbatim. The actual landing page URL is actually specified outside the Flash creative in the JavaScript that embeds the Flash creative on our pages. You won’t need to worry about that!

Multiple Clicks

  • For creative with multiple clicks, just use the above script for the first button; and for the other clicks replace _root.clickTAG with _root.clickTAG2, _root.clickTAG3, _root.clickTAG4 and _root.clickTAG5. You can have up to 5 click through destinations in your Flash creative for a given ad placement. Notice there are two references to the clickTAG variable in the button script so make sure you update both of them for your buttons. For example, for the third button in your multiple click creative, the script should look like this:
myButton.onRelease = function () {
    var a = _root.clickTAG3.toLowerCase();
    if (a.indexOf("http://") == 0 || a.indexOf("https://") == 0){
        getURL(_root.clickTAG3, "_blank");
    }
};

Forms

  • Forms that use user input to return more relevant results on the landing page should use the GET method. The default _root.clickTAG expression should still be used with the query string appended to it
  • Here is an examle where form_fname and form_lname are the query URL parameters and flash_fname and flash_lname the Flash form field values:
on (release){
    var a = _root.clickTAG.toLowerCase();
    if (a.indexOf("http://") == 0 || a.indexOf("https://") == 0){
        qs = "form_fname=" + escape(flash_fname) + "&form_lname=" + escape(flash_lname);
        getURL(_root.clickTAG + qs , "_blank");
    }
}
// clickTAG will hold the script location including the '?'
// for example, http://search.yahoo.com/search?

Click through

  • Most banners ads click through to a landing page to give the user more information about the advertiser’s product/services. This is achieved by creating a button in your Flash creative. The ActionScript attached to the frame, which let’s say has the instance name myButton, must always look like this (NB the button called “myButton” need to be already present at the same time on the timeline):
myButton.addEventListener(MouseEvent.CLICK, onButtonClick);
function onButtonClick(evt:MouseEvent):void {
var a:String = unescape(root.loaderInfo.parameters.clickTAG.toLowerCase());
	if (a.indexOf("http://") === 0 || a.indexOf("https://") === 0 ) {
		navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG), '_blank');
	}
}
myButton.buttonMode = true; //only include this line if your ‘button’ is a MovieClip
  • The above script should not be modified in any way and be used verbatim. The actual landing page URL is actually specified outside the Flash creative in the JavaScript that embeds the Flash creative on our pages. You won’t need to worry about that!

Multiple Clicks

  • For creative with multiple clicks, just use the above script for the first button; and for the other clicks replace _root.clickTAG with _root.clickTAG2, _root.clickTAG3, _root.clickTAG4 and _root.clickTAG5. You can have up to 5 click through destinations in your Flash creative for a given ad placement. Notice there are two references to the clickTAG variable in the button script so make sure you update both of them for your buttons. For example, for the third button in your multiple click creative, the script should look like this:
myButton.addEventListener(MouseEvent.CLICK, onButtonClick);
function onButtonClick(evt:MouseEvent):void {
var a:String = unescape(root.loaderInfo.parameters.clickTAG2.toLowerCase());
	if (a.indexOf("http://") === 0 || a.indexOf("https://") === 0 ) {
		navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG2), '_blank');
	}
}
myButton.buttonMode = true; //only include this line if your ‘button’ is a MovieClip

Forms

  • Forms that use user input to return more relevant results on the landing page should use the GET method. The default _root.clickTAG expression should still be used with the query string appended to it
  • Here is an examle where form_fname and form_lname are the query URL parameters and flash_fname and flash_lname the Flash form field values:
myButton.addEventListener(MouseEvent.CLICK, onButtonClick);
function onButtonClick(evt:MouseEvent):void {
var a:String = unescape(root.loaderInfo.parameters.clickTAG.toLowerCase());
var qs:String = "?form_fname=" + escape(flash_fname) + "%26form_lname=" + escape(flash_lname);
	if (a.indexOf("http://") === 0 || a.indexOf("https://") === 0 ) {
		navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG + qs), '_blank');
	}
}
myButton.buttonMode = true; //only include this line if your ‘button’ is a MovieClip

// clickTAG will hold the script location including the '?'
// for example, http://search.yahoo.com/search?