Navigate to URL. Invoke optional javascript popup


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.