·您当前的位置:首页 > 技术教程 > AS2与AS3技术 >

[AS3]全屏与自适应屏幕的源文件

时间:2011-10-15 12:31taoshaw.com
[AS3]全屏与自适应屏幕的源文件

AS3:
//全屏部分

import flash.display.StageScaleMode;
stage.scaleMode = StageScaleMode.NO_SCALE ;

stage.align = "LT";
stage.addEventListener(Event.RESIZE, onStageResize);
_init();
function _init():void {
var _w:int=stage.stageWidth;
var _h:int=stage.stageHeight;
mc_fullscreen.x=_w-100;
mc_fullscreen.y=_h-22;
ding_Menu.x=_w-700;
ding_Menu.y=20;
stage.addEventListener(Event.RESIZE, onStageResize);
}
function onStageResize(e:Event):void {
var w:int=stage.stageWidth;
var h:int=stage.stageHeight;
mc_fullscreen.x=w-100;
mc_fullscreen.y=h-22;
ding_Menu.x=w-700;
ding_Menu.y=20;
}
var my_b:Boolean=true;
mc_fullscreen.buttonMode=true;
mc_fullscreen.addEventListener(MouseEvent.CLICK,_fullscreen);
function _fullscreen(e:MouseEvent):void {
if (my_b) {
stage.displayState="fullScreen";
} else {
stage.displayState="normal";
}
my_b=! my_b;
}

 

热门文章推荐

请稍候...

保利威视云平台-轻松实现点播直播视频应用

酷播云数据统计分析跨平台播放器