Flex调Javascript打开新窗口示例代码(flex缩放)不要告诉别人

随心笔谈11个月前发布 admin
84 0

xmlns:s=”library://ns.adobe.com/flex/spark”

xmlns:mx=”library://ns.adobe.com/flex/mx”>

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()”);

}

protected function openButton_clickHandler(event:MouseEvent):void

{

openWindow(“http://www.baidu.com”,”百度”);

}

]]>

© 版权声明

相关文章