代码
btn.addEventListener(MouseEvent.CLICK,goFullScreen);
function goFullScreen(event:MouseEvent):void {
switch (stage.displayState) {
case "normal" :
stage.displayState = "fullScreen";
break;
case "fullScreen" :
default :
stage.displayState = "normal";
break;
}
}
function goFullScreen(event:MouseEvent):void {
switch (stage.displayState) {
case "normal" :
stage.displayState = "fullScreen";
break;
case "fullScreen" :
default :
stage.displayState = "normal";
break;
}
}
注:flash cs3,Ctrl+enter,这些代码没效果,直接点生成出来的swf文件即可,如果是网页,html里面allowFullScreen必须改为true