Posted By

mecsekikrisztian on 03/24/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dabrave


AS2 / AS3 clickTag for banners


 / Published in: ActionScript
 

  1. // _ AS2 _
  2.  
  3. on (release){
  4. getURL(_root.clickTag,"_blank")
  5. }
  6. ________________________________________________________________________________________
  7.  
  8.  
  9. // _ AS3 _
  10.  
  11. buttonMode=true;
  12. addEventListener(MouseEvent.CLICK,vOpen);
  13. function vOpen(event:MouseEvent):void {
  14. navigateToURL(new URLRequest(findVar("clicktag")), findVar("clicktarget"));
  15. }
  16. function findVar(vari:String):String {
  17. for (var key:String in root.loaderInfo.parameters)
  18. if(key.toLowerCase()== vari)
  19. return root.loaderInfo.parameters[key];
  20. return "";
  21. }

Report this snippet  

You need to login to post a comment.