ActionScript 3 AS3 Javascript弹出窗口
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 AS3 Javascript弹出窗口相关的知识,希望对你有一定的参考价值。
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);
}
}
}
}
}
以上是关于ActionScript 3 AS3 Javascript弹出窗口的主要内容,如果未能解决你的问题,请参考以下文章
[ActionScript 3.0] AS3.0 水面波纹效果
ActionScript 3 AS3:使用SWFObject2和AS3传递变量
ActionScript 3 克隆数组(AS3)
ActionScript 3 AS3序列化
ActionScript 3 As3初始上限
ActionScript 3 AS3 HTML清理