Skip to content
June 25, 2012 / Danii Oliver

Action Script 3 clicktag-

Action Script 3 – Banner Ad Dynamic clickthrough functionality.

function handleClick(mouseEvent:MouseEvent):void {

var interactiveObject:InteractiveObject = as InteractiveObject;

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

var url:String = li.parameters.clicktag;

if (url) {

if (ExternalInterface.available) {

var userAgent:String =‘function(){ return navigator.userAgent; }’);

if (userAgent.indexOf(“MSIE”) >= 0) {‘’, url, ‘_blank’);

} else {

navigateToURL(new URLRequest(url), ‘_blank’);


} else {

navigateToURL(new URLRequest(url), ‘_blank’);





For this clicktag to work in all browsers the following two requirements need to be met:

  • The html object tag needs an id or Internet Explorer will generate a javascript error of “null is null or not an object”.
  • AllowScriptAccess needs to be true either by setting it to “always” or by setting it to “sameDomain” and loading the flash from the same domain as the hosting page.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s