as3.0 实现FLASH在浏览器中全屏

在HTML里加入如下代码
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,60"
width="600"  height="400" id="fullscreen" align="middle">
<param name="allowFullScreen" value="true" />
<param name="movie" value="fullscreen.swf" />
<param name="bgcolor" value="#333333" />
<embed src=http://www.y360.net/FLASHEDU_GP/"fullscreen.swf" allowFullScreen="true" bgcolor="#333333" width="600" height="400"
name="fullscreen" align="middle" type="application/x-shockwave-flash" 
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

as3.0代码

import flash.display.Stage;
import flash.display.StageDisplayState;
import flash.events.FullScreenEvent;

stage.displayState = StageDisplayState.FULL_SCREEN //启动全屏幕
stage.displayState = StageDisplayState.NORMAL //返回一般模式

对于全屏事件可以这样写
Stage.addEventListener( FullScreenEvent.FULL_SCREEN, fullScreenHandler );
private function fullScreenHandler( event:FullScreenEvent ):void {
    if ( event.fullScreen == true ) {
        //如果当前是全屏模式
    } else if ( event.fullScreen == false ) {
        //如果当前是一般模式
    }
};

你可能感兴趣的:(职场,AS,休闲)