<script language="JavaScript" type="text/javascript"> function fullScreen() { //alert("fullscreen"); var wsh = new ActiveXObject("wscript.shell"); try{wsh.sendKeys("{F11}");} catch(e){alert(e);} WshShell.Quit; } </script>
代码没有问题,怎么也测试不过去。后来把站点加为信任站点,终于解决了。
把上面代码放到<head></head>之间,然后在Flex的函数中调用:
ExternalInterface.call("fullScreen");
其中fullScreen就是javascript函数的名字,这样就实现了在Flex中控制IE全屏。