Posted By

StrawMan on 05/27/09


Tagged

url javascript navigation as3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

abbey
ballen205


Navigate to URL. Invoke optional javascript popup


 / Published in: ActionScript 3
 

  1. private var _urlStr:String;
  2. private var _webPageURL:URLRequest;
  3. private var _targ:String;
  4. private var _jscommand:String;
  5. private var _popup:Boolean;
  6.  
  7. /////////////////////////////
  8. //Navigate to URL.
  9. //////////////////////////////
  10. private function goToURL (_urlStr, _targ, _popup):void {
  11. if(_popup) {
  12. _jscommand = "window.open('" + _urlStr + "','PopUpWindow','height=550,width=350,toolbar=no,scrollbars=no,resizable=yes');";
  13. _webPageURL = new URLRequest("javascript:" + _jscommand + " void(0);");
  14. } else {
  15. _webPageURL = new URLRequest(_urlStr);
  16. }
  17. navigateToURL (_webPageURL, _targ);
  18. }
  19. //////////////////////////////

Report this snippet  

You need to login to post a comment.