`

Flex3 全屏显示

    博客分类:
  • Flex
阅读更多

有网友说Felx2里面的全屏显示代码不能用了,因为flex3里面没有flash.display.StageDisplayState,
其实只要稍作修改就可以了

FullScree.mxml代码

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundGradientColors="[#8080ff, #400040]">   
    <mx:Script>
        <![CDATA[
        import flash.display.Stage;
        private function toggle():void{
            if(fs.selected == true){
                this.goFullScreen();
            } else {
                this.exitFullScreen();
            }
        }       
        private function goFullScreen():void {
               stage.displayState = 'fullScreen';
        }
        private function exitFullScreen():void {
               stage.displayState = 'normal';
        }
        ]]>
    </mx:Script>
    
    <mx:Panel width="100%" height="100%" title="轻松实现全屏" 
layout="absolute">
        <mx:CheckBox label="全屏" id="fs" click="this.toggle()" 
    horizontalCenter="0" verticalCenter="0"/>
    </mx:Panel>    
</mx:Application> 

 

index.template.html代码(html-template文件夹下)

<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--  BEGIN DeepLinking required section -->
<link rel="stylesheet" type="text/css" href="deeplinking/deeplinking.css" />
<!--  END DeepLinking required section -->

<title>${title}</title>
<script src="AC_OETags.js" language="javascript"></script>

<!--  BEGIN DeepLinking required section -->
<script src="deeplinking/deeplinking.js" language="javascript"></script>
<!--  END DeepLinking required section -->

<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = ${version_major};
// Minor version of Flash required
var requiredMinorVersion = ${version_minor};
// Minor version of Flash required
var requiredRevision = ${version_revision};
// -----------------------------------------------------------------------------
// -->
</script>
</head>

<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);


// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasRequestedVersion ) {
 // MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
 // This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
 // DO NOT MODIFY THE FOLLOWING FOUR LINES
 // Location visited after installation is complete if installation is required
 var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
 var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;

 AC_FL_RunContent(
  "src", "playerProductInstall",
  "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
  "width", "${width}",
  "height", "${height}",
  "align", "middle",
  "id", "${application}",
  "quality", "high",
  "bgcolor", "${bgcolor}",
  "name", "${application}",
  "allowScriptAccess","sameDomain",
  "allowFullScreen","true",
  "type", "application/x-shockwave-flash",
  "pluginspage", "http://www.adobe.com/go/getflashplayer"
 );
} else if (hasRequestedVersion) {
 // if we've detected an acceptable version
 // embed the Flash Content SWF when all tests are passed
 AC_FL_RunContent(
   "src", "${swf}",
   "width", "${width}",
   "height", "${height}",
   "align", "middle",
   "id", "${application}",
   "quality", "high",
   "bgcolor", "${bgcolor}",
   "name", "${application}",
   "allowScriptAccess","sameDomain",
   "allowFullScreen","true",
   "type", "application/x-shockwave-flash",
   "pluginspage", "http://www.adobe.com/go/getflashplayer"
 );
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be placed here. '
   + 'This content requires the Adobe Flash Player. '
    + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  // insert non-flash content
  }
// -->
</script>
<noscript>
   <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
   id="${application}" width="${width}" height="${height}"
   codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
   <param name="movie" value="${swf}.swf" />
   <param name="quality" value="high" />
   <param name="bgcolor" value="${bgcolor}" />
   <param name="allowScriptAccess" value="sameDomain" />
   <embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
    width="${width}" height="${height}" name="${application}" align="middle"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="sameDomain"
    allowFullScreen="true"
    type="application/x-shockwave-flash"
    pluginspage="http://www.adobe.com/go/getflashplayer">
   </embed>
 </object>
</noscript>
</body>
</html>

还需要修改mxml对应的html页面
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- BEGIN DeepLinking required section --> <link rel="stylesheet" type="text/css" href="deeplinking/deeplinking.css" /> <!-- END DeepLinking required section -->

 

<title></title> <script src="AC_OETags.js" language="javascript"></script>

 

<!-- BEGIN DeepLinking required section --> <script src="deeplinking/deeplinking.js" language="javascript"></script> <!-- END DeepLinking required section -->

 

<style> body { margin: 0px; overflow:hidden } </style> <script language="JavaScript" type="text/javascript"> <!-- // ----------------------------------------------------------------------------- // Globals // Major version of Flash required var requiredMajorVersion = 9; // Minor version of Flash required var requiredMinorVersion = 0; // Minor version of Flash required var requiredRevision = 28; // ----------------------------------------------------------------------------- // --> </script> </head>

 

<body scroll="no"> <script language="JavaScript" type="text/javascript"> <!-- // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) var hasProductInstall = DetectFlashVer(6, 0, 65);

 

// Version check based upon the values defined in globals var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

 

// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback if ( hasProductInstall && !hasRequestedVersion ) { // MMdoctitle is the stored document.title value used by the installation process to close the window that started the process // This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed // DO NOT MODIFY THE FOLLOWING FOUR LINES // Location visited after installation is complete if installation is required var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; var MMredirectURL = window.location;     document.title = document.title.slice(0, 47) + " - Flash Player Installation";     var MMdoctitle = document.title;

 

AC_FL_RunContent(    "src", "playerProductInstall",    "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",    "width", "100%",    "height", "100%",    "align", "middle",    "id", "app",    "quality", "high",    "bgcolor", "#282828",    "name", "app",    "allowScriptAccess","sameDomain",    "allowFullScreen","true",    "type", "application/x-shockwave-flash",    "pluginspage", "http://www.adobe.com/go/getflashplayer" ); } else if (hasRequestedVersion) { // if we've detected an acceptable version // embed the Flash Content SWF when all tests are passed AC_FL_RunContent(     "src", "app",     "width", "100%",     "height", "100%",     "align", "middle",     "id", "app",     "quality", "high",     "bgcolor", "#282828",     "name", "app",     "allowScriptAccess","sameDomain",     "allowFullScreen","true",     "type", "application/x-shockwave-flash",     "pluginspage", "http://www.adobe.com/go/getflashplayer" ); } else { // flash is too old or we can't detect the plugin     var alternateContent = 'Alternate HTML content should be placed here. ' + 'This content requires the Adobe Flash Player. '    + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';     document.write(alternateContent); // insert non-flash content } // --> </script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"     id="app" width="100%" height="100%"     codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">     <param name="movie" value="app.swf" />     <param name="quality" value="high" />     <param name="bgcolor" value="#282828" />     <param name="allowScriptAccess" value="sameDomain" />     <embed src="app.swf" quality="high" bgcolor="#282828"      width="100%" height="100%" name="app" align="middle"      play="true"      loop="false"      quality="high"      allowScriptAccess="sameDomain"      allowFullScreen="true"      type="application/x-shockwave-flash"      pluginspage="http://www.adobe.com/go/getflashplayer">     </embed> </object> </noscript> </body> </html>


 

 

 

分享到:
评论

相关推荐

    flex 控件 全屏显示

    点击空间可以在屏幕上全屏显示,效果很炫,很牛-- 点击空间可以在屏幕上全屏显示,效果很炫,很牛

    Flex 组件全屏 部分全屏的实现 代码

    Flex 组件全屏 部分全屏的实现 一般情况下,Flex全屏是指将整个舞台全屏,而不是待定的组件全屏.网上的例子也一般是指这种情况的. 下面发布一下,将特定组件全屏的代码:

    Flex 组件全屏的组件

    里面少了一个针对按下ESC键的处理,这个在使用的时候可以自己加,另外一个问题就是由于这个库是FLEX3的,所以在FLEX4.0或以上的版本(使用的spark主题)的时候,需要修改类里面的Canvas为Group或者其他的显示容器,...

    Flex 全屏显示 JasPine.rar

    util.as 文件中 修改goFullScreen 方法 有注释可以看到默认的时候是蒙上了一层黑色背景,测试的时候我给改成白色了

    flex iframe 支持在flash中嵌套入html jsp asp php等

    flex iframe 支持在flash中嵌套入html jsp asp php等flex iframe 支持在flash中嵌套入html jsp asp php等flex iframe 支持在flash中嵌套入html jsp asp php等flex iframe 支持在flash中嵌套入html jsp asp php等flex...

    ActionScript开发人员指南中文版

    显示全屏窗口 第章:AIR中的显示屏幕 AIR中的显示屏幕的基础知识 枚举屏幕 第章:打印 打印基础知识 打印页面 Flash运行时任务和系统打印 设置大小、缩放和方向 高级打印技术 打印示例:多页面打印 打印示例:缩放、...

    react-native-frame-loading:像动画LoadingIndicator一样,在React-Native中具有逐帧视图

    React本机加载 ... flex: 1, "center" 目的 浮动视图容器的样式对象 用法 import FrameLoading from "react-native-frame-loading" import Icon from "react-native-vector-icons/FontAwesome" const

    PHPdtb V1.0 正式版

    没事的,PHPdtb 采用FLEX技术,早就实现了防盗功能,你只需要在后台设置中心,把图片的显示方式改为FLASH显示就可以了。并且还支持图片全屏观看。 后台外部工具集,可以让您随时查看到网站的收录情况和Alexa世界排名...

    hexo-theme-gstyle:具有Google风格的hexo主题

    没有引导程序,使用现代CSS3 flex!令人印象深刻的导航 手机全屏变形导航内容表优美的模块展开和折叠时自动生成带有过渡动画的目录。用法git clone https://github.com/wayou/hexo-theme-gstyle.git themes/gstyle ...

    e-Commerce:使用react-scroll的单个响应式页面站点

    使用显示网格而不是flex添加卡片部分 有一个“ Data.js”文件,我可以导入内容,而不是对每个组件中的所有内容进行硬编码 目标 创建一个响应式且有吸引力的单页应用程序 创建具有更好编码实践的可重用组件 改善我CSS...

    angular-modal-gallery:Angular的模态图像库

    modal-gallery :是该项目的核心部分,显示一个具有全屏图像,按钮,当前图像以及可选的导航点和预览的模式窗口 轮播:是7.0.0版中引入的新功能,用于显示具有自动播放和其他出色功能的可配置普通轮播(非模式) @ ...

Global site tag (gtag.js) - Google Analytics