Skip to content

Instantly share code, notes, and snippets.

@mattlundstrom
Last active December 23, 2015 07:49
Show Gist options
  • Select an option

  • Save mattlundstrom/6603006 to your computer and use it in GitHub Desktop.

Select an option

Save mattlundstrom/6603006 to your computer and use it in GitHub Desktop.
Standard Banner clickTag code w/ js MSIE popup workaround
myMovieClip.addEventListener(MouseEvent.CLICK, handleClick);
function handleClick(e:MouseEvent):void {
var interactiveObject:InteractiveObject = e.target as InteractiveObject;
var li:LoaderInfo = LoaderInfo(interactiveObject.root.loaderInfo);
var url:String = li.parameters.clickTag;
if (url) {
if (ExternalInterface.available) {
var userAgent:String = ExternalInterface.call('function(){ return navigator.userAgent; }');
if (userAgent.indexOf("MSIE") >= 0) {
ExternalInterface.call('window.open', url, '_blank');
} else {
navigateToURL(new URLRequest(url), '_blank');
}
} else {
navigateToURL(new URLRequest(url), '_blank');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment