public function handleClick(mouseEvent:MouseEvent):void {
var interactiveObject:InteractiveObject = mouseEvent.target as InteractiveObject;
var li:LoaderInfo = LoaderInfo(interactiveObject.root.loaderInfo);
var url:String;
for (var i:String in li.parameters) {
if (i.toLowerCase() == "clicktag") {
url = li.parameters[ i ];
}
}
if (url) {
if (ExternalInterface.available) {
ExternalInterface.call('window.open',url);
}else {
navigateToURL(new URLRequest(url),"_blank");
}
}else {
if(ExternalInterface.available) ExternalInterface.call('console.log', "ClickTAG: Couldn't find a valid clicktag variable");
}
}
myButton.addEventListener(MouseEvent.CLICK,handleClick);
as3
1
publicfunction handleClick(mouseEvent:MouseEvent):void{varinteractiveObject:InteractiveObject=mouseEvent.targetasInteractiveObject;varli:LoaderInfo=LoaderInfo(interactiveObject.root.loaderInfo);varurl:String;for(vari:Stringinli.parameters){if(i.toLowerCase()=="clicktag"){url=li.parameters[i];}}if(url){if(ExternalInterface.available){ExternalInterface.call('window.open',url);}else{navigateToURL(newURLRequest(url),"_blank");}}else{if(ExternalInterface.available)ExternalInterface.call('console.log',"ClickTAG: Couldn't find a valid clicktag variable");}}myButton.addEventListener(MouseEvent.CLICK,handleClick);
Hey there! I see you're running Internet Explorer 6.
That's neat. This reminds me of my grandpa. He had this old car that he kept having to fix. He spent so much money on it that he didn't want to get rid of it (even when it stopped running).
0 Comments