mattlundstrom
9/18/2013 - 12:58 AM

Standard Banner clickTag code w/ js MSIE popup workaround

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');
        }
    }
}