`
hereson
  • 浏览: 1430987 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

Flex全屏

    博客分类:
  • flex
阅读更多

private function goFullScreen():void {
stage.displayState = StageDisplayState.FULL_SCREEN;
}

private function exitFullScreen():void {
stage.displayState = StageDisplayState.NORMAL;
}

加了以上代码,还要对html模版进行修改,然后调用上面的函数就行了

displayState property  
displayState:String   [read-write]

A value from the StageDisplayState class that specifies which display state to use. The following are valid values:

  • StageDisplayState.FULL_SCREEN Sets Flash Player to expand the stage over the user's entire screen.
  • StageDisplayState.NORMAL Sets the player back to the standard stage display mode.

 

The scaling behavior of the movie in full-screen mode is determined by the scaleMode setting (set using the Stage.scaleMode property or the SWF file's embed tag settings in the HTML file). If the scaleMode property is set to noScale while Flash Player transitions to full-screen mode, the Stage width and height properties are updated, and Flash Player dispatches the Stage.resize event.

The following restrictions apply to SWF files that play within an HTML page (not those using the stand-alone Flash Player):

  • To enable full-screen mode, add the allowFullScreen parameter to the object and embed tags in the HTML page that includes the SWF file, with allowFullScreen set to "true", as shown in the following example:
    <param name="allowFullScreen" value="true" />
              ...
       <embed src="example.swf" allowFullScreen="true" ... >

    An HTML page may also use a script to generate SWF-embedding tags. You need to alter the script so that it inserts the proper allowNetworking settings. HTML pages generated by Flash and FlexBuilder use the AC_FL_RunContent() function to embed references to SWF files, and you need to add the allowNetworking parameter settings, as in the following:

    AC_FL_RunContent( ... "allowFullScreen", "true", ... )
  • Full-screen mode is initiated in response to a mouse click or key press by the user; the movie cannot change Stage.displayState without user input. While Flash Player is in full-screen mode, all keyboard input is disabled (except keyboard shortcuts that take the user out of full-screen mode). A Flash Player dialog box appears over the movie when users enter full-screen mode to inform the users they are in full-screen mode and that they can press the Escape key to end full-screen mode.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics