[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;
}
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例