打开一个新窗口:
第一种方式:直接打开
var requestURL:URLRequest = new URLRequest("http://203.175.145.138/mayor/index.TJ?mayor=1"); navigateToURL(requestURL, "_blank");
第二种方式:触发函数打开:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:page="pager.*" width="100%" height="100%" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" layout="absolute" verticalAlign="top" horizontalAlign="center" pageTitle="打开新窗口" creationComplete="treeData()"> <mx:Style source="skins/blue/blue.css"/> <mx:Script> <![CDATA[ private function treeData():void{ if(...){ deptbuttontype = true; }else { deptbuttontype = false; } } private function loginSystem():void{ ExternalInterface.call('window.location',"./../jx.jsp"); }
private function closeSystem():void{
ExternalInterface.call('window.close()');
}
]]> </mx:Script> <mx:Panel height="100%" width="100%" > <mx:Button id="button" width="55" height="25" label="打开" click="loginSystem()" visible="{deptbuttontype}/>
<mx:Button width="55" height="25" label="关闭" click="closeSystem()"/> </mx:Panel> </mx:Application>