WEB开发网
开发学院图形图像Flash [AS3]全屏与自适应屏幕的源文件 阅读

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

 2012-02-06 12:15:07 来源:本站整理   
核心提示:AS3://全屏部分import flash.display.StageScaleMode;stage.scaleMode = StageScaleMode.NO_SCALE ;stage.align = "LT";stage.addEventListener(Event.RESIZE, onSta

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;
}

Tags:AS 适应 屏幕

编辑录入:coldstar [复制链接] [打 印]
赞助商链接