博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
flash as3设置全屏
阅读量:4167 次
发布时间:2019-05-26

本文共 1298 字,大约阅读时间需要 4 分钟。

/**

* Flash CS3中代码设置FlashPlayer全屏 actionScript3.0 player9
* @author xuechong
* @version 0.2
* @date 2011.02.21 - 2011.05.27
* */

/**

* 默认下Flash影片会居中显示。可以利用任何可视化对象的stage.align属性来重新设置电影的对齐方式。
* flash.display.StageAlign 类的属性:
* 这里没有水平和垂直都居中的模式,其实,默认模式就是它了,
* 但如果你改变了对其方式又想回到默认模式这时后只能传递空字符串""。
* Value Vertical alignment Horizontal
* StageAlign.TOP Top Center
* StageAlign.BOTTOM Bottom Center
* StageAlign.LEFT Center Left
* StageAlign.RIGHT Center Right
* StageAlign.TOP_LEFT Top Left
* StageAlign.TOP_RIGHT Top Right
* StageAlign.BOTTOM_LEFT Bottom Left
* StageAlign.BOTTOM_RIGHT Bottom Right
* */

import flash.display.Stage;

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

//btnID是可视对象或Flash cs中拖到画布上的原件

btnID.addEventListener(MouseEvent.CLICK, clickHander);

function clickHander(event:MouseEvent):void{

this.stage.displayState = StageDisplayState.FULL_SCREEN; //启动全屏幕
this.stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenHandler); //监听FlashPlayer全屏模式事件
}

function fullScreenHandler(event:FullScreenEvent):void{

if(event.fullScreen == true){ //如果当前是全屏模式
//trace("FlashPlayer全屏模式了");
}else if(event.fullScreen == false){ //如果当前是一般模式
//trace("FlashPlayer还原模式了");
}
this.stage.scaleMode = StageScaleMode.NO_SCALE;
//this.stage.align = StageAlign.TOP_RIGHT;
}

转载地址:http://kogxi.baihongyu.com/

你可能感兴趣的文章
Mysql中下划线问题
查看>>
Xcode 11 报错,提示libstdc++.6 缺失,解决方案
查看>>
vue项目打包后无法运行报错空白页面
查看>>
1136 . 欧拉函数
查看>>
面试题:强制类型转换
查看>>
Decorator模式
查看>>
Template模式
查看>>
Observer模式
查看>>
高性能服务器设计
查看>>
图文介绍openLDAP在windows上的安装配置
查看>>
Pentaho BI开源报表系统
查看>>
Pentaho 开发: 在eclipse中构建Pentaho BI Server工程
查看>>
android中SharedPreferences的简单例子
查看>>
android中使用TextView来显示某个网址的内容,使用<ScrollView>来生成下拉列表框
查看>>
andorid里关于wifi的分析
查看>>
Hibernate和IBatis对比
查看>>
Spring MVC 教程,快速入门,深入分析
查看>>
Android 的source (需安装 git repo)
查看>>
LOCAL_PRELINK_MODULE和prelink-linux-arm.map
查看>>
Ubuntu Navicat for MySQL安装以及破解方案
查看>>