语录提交--登陆--注册--论坛交流--站长博客

Flex 下实现全屏

[作者:来自网络][日期:2007-12-28][导航:Flash教程 >> Flex >> Flex 下实现全屏]
  

作者:猫大哥

要求:FlashPlayer版本为version 9,0,28,0或更高

适用于:Html页中和FlashPlayer中

创作环境: Adobe Flex Builder 2 (本例)/ Adobe Flash CS3

1:在flex中拖一个Button到场景,

设置:id="mybtn" click="fullScreen(event)"

2:定义fullScreen方法:

 

import flash.display.StageDisplayState;

 

private function fullScreen(event:MouseEvent):void{

if (stage.displayState == StageDisplayState.FULL_SCREEN)

{

mybtn.label = "全屏模式";

stage.displayState = StageDisplayState.NORMAL;

}

else

{

mybtn.label = "返回全屏";

stage.displayState = StageDisplayState.FULL_SCREEN;

}

}

 

3:如果使用原html模板装载,修改html-template文件夹下的index.template.html

在下面三处地方增加:

 

AC_FL_RunContent( ... "allowFullScreen", "true", ... )

 

<param name="allowFullScreen" value="true" />

...

<embed src="http://www.flexs.cn/post/"fullScreen.swf" allowFullScreen="true" ... >

在下面三处地方删除:

 

AC_FL_RunContent( ... "allowscrīptAccess", "sameDomain", ... )

 

<param name="allowscrīptAccess" value="sameDomain" />

...

<embed src="http://www.flexs.cn/post/"fullScreen.swf" allowscrīptAccess="sameDomain" ... >

[文章热度:]


上一页:Apollo的File I/O API

下一页:Flex Explorer资源大全

最新话题

网站导航

搜索

网站公告


Copyright 2007 51as.com. Some Rights Reserved.
鄂ICP备07003189号

Powered by: KingCMS 5.0.1.0217