測試應(yīng)用TestJavascript.mxml
復(fù)制代碼 代碼如下:
?xml version="1.0" encoding="utf-8"?>
s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
fx:Script>
![CDATA[
private function openWindow(pageUrl:String,pageName:String):void{
var jsString:String="";
jsString+=" var screenWidth = screen.availWidth, screenHeight = screen.availHeight;";
jsString+=" var args = 'toolbar=no, menubar=no, scrollbars=no,resizable=yes,location=no, status=no';";
//打開全屏的新窗口
jsString+=" var win = window.open('"+pageUrl+"','"+pageName+"',args);";
jsString+=" if(win){";
jsString+=" win.resizeTo(screenWidth,screenHeight);";
jsString+=" win.outerWidth = screenWidth;";
jsString+=" win.outerHeight = screenHeight;";
jsString+=" win.moveTo(0,0);";
jsString+=" }";
ExternalInterface.call("function(){"+jsString+"}");
}
protected function openButton_clickHandler(event:MouseEvent):void
{
openWindow("http://www.baidu.com","百度");
}
]]>
/fx:Script>
s:Button id="openButton" label="打開百度" click="openButton_clickHandler(event)"/>
/s:Application>
您可能感興趣的文章:- JS打開新窗口的2種方式
- js打開新窗口方法整理
- JS打開新窗口防止被瀏覽器阻止的方法
- javascript打開新窗口同時(shí)關(guān)閉舊窗口
- 打開新窗口關(guān)閉當(dāng)前頁面不彈出關(guān)閉提示js代碼
- JS關(guān)閉窗口與JS關(guān)閉頁面的幾種方法小結(jié)
- JavaScript無提示關(guān)閉窗口(兼容IE/Firefox/Chrome)
- IE JS無提示關(guān)閉窗口不提示的方法
- JavaScript實(shí)現(xiàn)自動(dòng)彈出窗口并自動(dòng)關(guān)閉窗口的方法
- JS關(guān)閉窗口或JS關(guān)閉頁面的幾種代碼分享
- JS關(guān)閉窗口時(shí)產(chǎn)生的事件及用法示例
- JavaScript實(shí)現(xiàn)單擊網(wǎng)頁任意位置打開新窗口與關(guān)閉窗口的方法