`

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是一种用于构建跨平台桌面应用程序和移动应用程序的开源框架。它基于Adobe Flash平台,并利用MXML(标记语言)和ActionScript(脚本语言)来创建用户界面和控制逻辑。全屏显示是指将...

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

    标题"Flex 组件全屏 部分全屏的实现 代码"涉及到如何在Flex环境中实现一个特定组件的全屏显示,而不仅仅是将整个舞台全屏化。描述中提到,虽然网上大多数例子都是关于舞台全屏的实现,但这里我们将探讨如何让某个...

    Flex 组件全屏的组件

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

    Flex 全屏显示 JasPine.rar

    在Flex开发中,全屏显示是一项重要的功能,它允许用户沉浸式体验应用,尤其是在多媒体、游戏或演示场景中。在给定的“Flex 全屏显示 JasPine.rar”压缩包文件中,我们重点关注的是“util.as”文件内的`goFullScreen`...

    Flex 3.2全屏模式的解决办法

    在IT行业中,Adobe Flex是一种基于ActionScript 3的开源框架,用于构建富互联网应用程序(RIA)。Flex 3.2是该框架的一个版本,它提供了一系列工具和技术,帮助开发者创建交互性强、图形丰富的Web应用程序。本篇文章...

    flex全屏代码 界面全屏

    标题和描述中提到的“flex全屏代码界面全屏”主要涉及的是在Flex框架下实现全屏显示的技术。Flex是一种开源框架,用于构建富互联网应用(RIA),可以在Flash Player或通过Adobe AIR部署到桌面。全屏功能是许多现代...

    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...

    flex 窗口托盘和全屏

    在Flex中,可以通过改变Stage的显示状态来实现全屏切换。有以下几种显示状态: - `StageDisplayState.NORMAL`:标准窗口模式。 - `StageDisplayState.FULL_SCREEN`:全屏模式,无浏览器或操作系统界面元素。 - `...

    Flex3 Flex Builder 3 快捷键一览

    ### Flex3与Flex Builder 3快捷键详解 在软件开发领域,提高开发效率是每个开发者追求的目标之一。Flex3及Flex Builder 3作为Adobe推出的一款用于构建富互联网应用程序(RIA)的强大工具集,其快捷键的掌握对于提高...

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

    然而,有时候我们可能只需要特定的组件全屏显示,而非整个应用。这个场景下的“部分全屏”功能是将一个指定的Flex组件(如一个窗口或某个控件)扩展至屏幕的边界,而其他部分保持不变。 以下是一个关于Flex部分全屏...

    javascript经典特效---文字全屏显示.rar

    3. **事件监听**:为了响应用户的行为,如点击按钮开启或关闭全屏显示,我们可以添加事件监听器,如`addEventListener`。通常,我们监听`click`事件,并在回调函数中执行全屏切换的逻辑。 4. **全屏API**:现代...

    [原创]FLEX 超简单的 组件 全屏 幻灯片 [附源码]

    2. **布局管理**:为了实现全屏显示,我们需要使用FLEX的布局管理器,例如AbsoluteLayout,让组件占据整个舞台。在MXML中设置`width="100%" height="100%"`可以让组件填充其父容器。 3. **图像加载**:FLEX提供了...

    flex4实现的简单相册实例

    3. **Spark组件**:Flex4引入了全新的Spark组件架构,相比Flex3的 Halo组件,Spark组件提供了更高级的外观和性能。在相册应用中,可能使用了`Image`组件来展示图片,`List`或`DataGrid`组件来显示图片列表。 4. **...

    flex itemRenderer深入学习--flex相册例子

    在Flex开发中,ItemRenderer是一种非常关键的组件,它允许我们自定义数据项在列表或网格等容器中的显示方式。本篇文章将深入探讨如何利用ItemRenderer实现一个灵活且功能丰富的相册示例,同时也会涉及Flex中的一些...

    flex 弹出窗口并居中显示

    4. 遮罩层效果:为了实现遮罩层效果,可以将`.popup-mask`的背景色设为半透明黑色,并设置`position: fixed`使其全屏显示。 5. 显示与隐藏:弹出窗口的显示和隐藏可以通过JavaScript控制,例如通过改变`display`...

    Flex4 电视墙效果

    3. **数据绑定**:Flex4支持强大的数据绑定机制,可以将数据源与UI组件关联,方便地更新显示内容。电视墙中的每个“电视”通常代表数据集中的一个条目,数据绑定能确保数据变化时UI自动更新。 4. **皮肤自定义**:...

    Flex电子相册2

    - 一个实用的电子相册通常包含图片浏览、前进/后退、全屏显示、缩略图预览等功能。Flex的`Button`、`Slider`和`NavigatorContent`等组件可以构建这些交互元素。 - 可能使用了`ArrayCollection`来存储和管理图片...

    Flex播放器实例带源码的flex制作的播放器

    第四个实例可能是一个完整的解决方案,包含所有前面提到的功能,并且可能加入了额外的特性,如全屏模式、字幕显示、播放历史记录等。这需要开发者具备良好的架构设计能力,将各个功能模块有效地组织在一起,同时保持...

    jquery点击图片全屏效果

    3. 将大图加载到弹出层中,并设置合适的样式使其全屏显示。 4. 实现左右切换功能,可以通过改变大图的`src`属性来切换图片。 5. 添加关闭按钮或点击背景关闭弹出层的功能。 以下是一个简单的示例代码: ```...

    arcgis_api_for_flex_3_5.zip_arcgis flex api 3.5_flex_flex viewer

    这个压缩包文件“arcgis_api_for_flex_3_5.zip”包含了ArcGIS Viewer for Flex 3.5的源码,是学习和开发基于Flex的GIS应用的重要资源。 ArcGIS Viewer for Flex 是一个强大的地图浏览和分析工具,它预设了多种地图...

Global site tag (gtag.js) - Google Analytics