7.5.10 全屏控制

可以使用Flash canvas阶段的stage属性值来设置全屏,但是考虑到正常的屏幕和宽屏处理,常见的显示分辨率可以分为4:3(1024×768),5:4(1280×1024) ),16:9,16:10(这里为宽屏测试,需要后续处理),点击全屏按钮或点击屏幕全屏可以调用display()方法,代码片段如下:

  //切換全屏显示 
private function display():void
{ 
    if(!isFullScreen)
    { 
        stage.fullScreenSourceRect = new Rectangle(video.x, video.y,video.width,video.height);
        stage.displayState =StageDisplayState.FULL_SCREEN; 
        isFullScreen = true; 
    }else
    { 
        stage.displayState = StageDisplayState.NORMAL; 
        isFullScreen = false; 
    }

}

results matching ""

    No results matching ""