/ Published in: ActionScript 3
HtmlPageUtils.viewPopup("http://www.google.ca", "mypopup");
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.external.ExternalInterface; import flash.net.URLRequest; import flash.net.navigateToURL; public class HtmlPageUtils { public static function viewPopup(_address:String, _wname:String = "popup", _width:int = 400, _height:int = 400, _toolbar:String = "no", _scrollbar:String = "no", _resizeable:String = "yes"):void { var address:String = _address; var wname:String = _wname; var w:int = _width; var h:int = _height; var t:String = _toolbar; var s:String = _scrollbar; var r:String = _resizeable; if (ExternalInterface.available) { ExternalInterface.call("window.open", address, wname, "height=" + h + ",width=" + w + ",toolbar=" + t + ",scrollbars=" + s + ",resizable=" + r + ""); }else { var jscommand:String = "window.open('" + address + "','" + wname + "','height=" + h + ",width=" + w + ",toolbar=" + t + ",scrollbars=" + s + ",resizable=" + r + "');"; var url:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);"); try{ navigateToURL(url,"_self"); } catch (e:Error) { trace("Popup failed", e.message); } } } } }
URL: http://www.chrisbaigorri.com