Posted By

visualadvance on 01/21/10


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

ClayVillage
tspitzr
dubogii


AS3: ClickTag


 / Published in: ActionScript 3
 

The code to do banner clickTags in as3.

  1. function clickHandler(evt:MouseEvent):void
  2. {
  3. getURL(LoaderInfo(root.loaderInfo).parameters.clickTag);
  4. }
  5.  
  6. function getURL(url:String, window:String = "_blank"):void
  7. {
  8. var broswer : String = ExternalInterface.call("function getBrowser(){return navigator.userAgent}") as String;
  9.  
  10. if(broswer.indexOf("Firefox") != -1 || broswer.indexOf("MSIE 7.0") != -1)
  11. {
  12. ExternalInterface.call('window.open("' + url + '","' + window + '")');
  13. }else{
  14. navigateToURL(new URLRequest(url), window);
  15. }
  16. }

Report this snippet  

You need to login to post a comment.