FLEX 超简单的全屏幻灯片
主要问题:让容器中的组件全屏。因为默认的全屏是舞台全屏。
方法是设置两个组件,一个PopUpManager,点全屏的时候为可现。另一个为图中普通。(点击图片全屏)
flex 全屏的方法:
1.需要修改http-template文件夹下的index-template.html 用编辑器打开。
2.加入下面两个地方:(大概位置在这)
"allowFullScreen","true",


3.构建自己的全屏函数
private function fullScreen():void{ //全屏方法
isFull=true;
full.stage.displayState="fullScreen";
full.x=stage.x;
full.y=stage.y;
full.width=stage.stageWidth;
full.height=stage.stageHeight;
stage.addEventListener(FullScreenEvent.FULL_SCREEN,backCreen); //监听事件
full.visible=true;
}
private function backCreen(event:FullScreenEvent):void{//恢复方法
isFull=false;
full.visible=false;
full.width=1;
full.height=1;
stage.removeEventListener(FullScreenEvent.FULL_SCREEN,backCreen);//移除监听
}


本文介绍如何在Flex中实现容器组件的全屏显示功能。通过修改http-template下的index-template.html文件,并添加允许全屏参数,再结合自定义全屏函数及事件监听,最终达到全屏幻灯片的效果。
219

被折叠的 条评论
为什么被折叠?



