2011-08-18 48 views

回答

0

使用舞臺的displayState屬性。您可以在Application類上以變量的形式訪問該階段。在主應用程序標籤的applicationComplete事件處理

FlexGlobals.topLevelApplication.stage.displayState = StageDisplayState.FULL_SCREEN 

運行這段代碼把你的應用程序進入全屏模式被加載完成後:那麼,在概念上,做到這一點。

+0

感謝您的回覆,但我試圖讓我的錄像機切換到全屏默認運行狀態。我正在使用flex 4 videoplayer類 –

+0

@Gaurav Sharma爲什麼我的回答不會告訴你如何去做?你有沒有嘗試過,並有問題?如果是這樣,問題是什麼。 – JeffryHouser

1

從VideoPlayer的fullScreenButton派發點擊事件。

yourplayer.fullScreenButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); 
0

可以刪除的VideoDisplay從它的父,然後在全寬&高度添加到舞臺上。退出全屏時反轉該過程。

protected function fullScreenBtn_clickHandler(event:MouseEvent):void 
{ 
    videoContainer.removeChild(videoDisplay)   
    this.stage.addChild(videoDisplay); 
    this.stage.displayState = StageDisplayState.FULL_SCREEN; 
    videoDisplay.width = stage.width; 
    videoDisplay.height = stage.height; 
    this.stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); 
} 

protected function fullScreenHandler(event:FullScreenEvent):void 
{ 
    if(!event.fullScreen) 
    { 
     this.stage.removeChild(videoDisplay); 
     this.videoContainer.addChild(videoDisplay); 
     videoDisplay.percentHeight = videoDisplay.percentWidth = 100; 
     this.stage.removeEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); 
    } 
} 
相關問題