之前知道怎么通过按钮点击初始化Flex air程序
private function fullScreen():void{
if(fullChange.label=="全屏"){
stage.displayState = StageDisplayState.FULL_SCREEN;
fullChange.label="退出全屏";
}else{
stage.displayState = StageDisplayState.NORMAL;
fullChange.label="全屏";
}
<mx:Button label="全屏" click="fullScreen()"/>
但是我想运行主程序的时候就全屏,即整个项目启动时进入全屏的状态,之前在网上查了好多资料,最后在javaEye里面找到了思路
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication backgroundColor="black"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="callLater(fullScreen)">
private function fullScreen():void{
stage.displayState = StageDisplayState.FULL_SCREEN;
}
因为程序执行时从上往下,如果采用传统的creationComplete="callLater(fullScreen),就会提示找不到舞台stage,所以只能用上述的方法:用系调用函数调用自定义函数callLater(自定义函数名)
private function fullScreen():void{
if(fullChange.label=="全屏"){
stage.displayState = StageDisplayState.FULL_SCREEN;
fullChange.label="退出全屏";
}else{
stage.displayState = StageDisplayState.NORMAL;
fullChange.label="全屏";
}
<mx:Button label="全屏" click="fullScreen()"/>
但是我想运行主程序的时候就全屏,即整个项目启动时进入全屏的状态,之前在网上查了好多资料,最后在javaEye里面找到了思路
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication backgroundColor="black"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="callLater(fullScreen)">
private function fullScreen():void{
stage.displayState = StageDisplayState.FULL_SCREEN;
}
因为程序执行时从上往下,如果采用传统的creationComplete="callLater(fullScreen),就会提示找不到舞台stage,所以只能用上述的方法:用系调用函数调用自定义函数callLater(自定义函数名)