Flex全屏

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

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

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

displayStateproperty 
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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值