Posted By

IsoJon on 07/09/10


Tagged

url


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dubogii


Easily Target a URL with the Window Method of Your Choice


 / Published in: ActionScript 3
 

Great little snippet I use to target an external link.

  1. // gotoLink takes 3 parameters: the event, the URL string, and the method (_self, _blank, etc)
  2. //
  3. // sample usage:
  4. // gotoLink( evt, "http://google.com", "_blank" );
  5.  
  6.  
  7. function gotoLink( evt:Event, l:String, meth:String ) : void
  8. {
  9. var URLReq:URLRequest = new URLRequest(l);
  10. try
  11. {
  12. navigateToURL(URLReq, meth);
  13. } catch (e:Error)
  14. {
  15. trace(e);
  16. }
  17. }

Report this snippet  

You need to login to post a comment.