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

下面发布一下,将特定组件全屏的现在代码:

复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:TitleWindow x="113" y="62" width="337" height="263" layout="absolute" id="titleTest" title="单个控件全屏测试">
        <mx:VideoDisplay x="0" y="53" height="160" width="317" id="videoDisplay"/>
        <mx:Button x="134.5" y="98" label="全屏" id="btnFullScreen" click="fullScreen();" color="#F41131"/>
        <mx:Button x="134.5" y="10" label="全屏" id="btnFullScreen0" click="fullScreen();" color="#F41131"/>
    </mx:TitleWindow>
    <mx:Script>
        <!--[CDATA[
            //
            import com.util.fullscreen.FullScreenUtil;
            private function fullScreen():void{
                if(FullScreenUtil.isFullScreen){
                    btnFullScreen.label = '全屏!';
                    FullScreenUtil.exitFullScreen();
                }else{
                    btnFullScreen.label = '退出全屏!';
                    FullScreenUtil.goFullScreen();

                    // 加入要全屏的对像.videoDisplay
                    FullScreenUtil.addChild(videoDisplay, true, true, true);

                    // 将 btnFullScreen 放在全屏对像上.
                    FullScreenUtil.addChild(btnFullScreen, true, true, false, -1, -1, -1, 100);
                }
            }            
        ]]-->
    </mx:Script>
</mx:Application>

下面用到的操作全屏的类:
请到此下载:
http://download.csdn.net/source/1679251
当然还要修改HTML模块文件,修改如下:

复制代码 代码如下:

<!-- saved from url=(0014)about:internet -->
<html lang="en">

<!--
Smart developers always View Source.

This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.

Learn more about Flex at http://flex.org
// -->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" href="history/history.css" />
<!-- END Browser History required section -->

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

<!-- BEGIN Browser History required section -->
<script src="history/history.js" src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->

<style><!--
body { margin: 0px; overflow:hidden }
--></style><style bogus="1">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);

if ( hasProductInstall && !hasRequestedVersion ) {
    // 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",
        "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" href="http://www.adobe.com/go/getflash"></a>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" 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>

时间: 2024-10-23 18:14:43

Flex 全屏组件 部分全屏的实现代码_Flex的相关文章

Flex动态生成可编辑的DataGrid具体实现代码_Flex

一:先说说我写这个DataGrid具有的功能 1.表头是动态生成的. 2.每行都是有序号的. 3.每行都是可以编辑.插入.删除.修改的. 4.每个单元格都是加验证的. 5.单元格有些是经过渲染生成的比如:Combobox,DateField... 二.说一些实现这些功能的困难 写这个的时候感觉都是困难不知道,走过来了也就木有神马啦,最让我费劲的就是渲染例如:Combobox在渲染的时候不能用ItemRenderer因为他不能绑定值,只能用ItemEditor但是怎样获得这个一个经过渲染的对象,通

flex通过java后台获取ip和pcname示例代码_Flex

在***DAOImpl.java中的代码如下 复制代码 代码如下: public String getCompuName() { Map<String, String> map = System.getenv() ; String computerName = map.get("COMPUTERNAME");// 获取计算机名 return computerName; } public String getIp() { InetAddress addr = null; tr

FLEX 获取DataGrid行号和列号示例代码_Flex

一.获取行号 复制代码 代码如下: var findex:Number = Math.floor(dg.contentMouseY/dg.rowHeight)-1 + dg.verticalScrollPosition; //dg.contentMouseY是鼠标所在的local坐标系相对于datagrid的高度 //dg.rowHeight是datagrid的行高,math.floor作用是截断小数点 //verticalScrollPosition是如果datagrid有滚动条的话,向下滚动

Flex Label控件竖排显示文字的实现代码_Flex

复制代码 代码如下: private function rotationText(event:FlexEvent):void{ var text:String = event.currentTarget.text; var length:int = text.length; var newText:String = ""; for(var i:int = 0; i < length; i++) { newText+=text.charAt(i)+"\r"; }

java视频播放器怎么实现一个组件的全屏

问题描述 java视频播放器怎么实现一个组件的全屏 这是我做的播放器 我想让中间黑色屏幕实现无边框的全屏播放 我的思路是让上边 右边 和下边的三部分不可见setVisible(false) 然后效果如下 基本实现了全屏 但不能去掉边框 setUndecorated方法可以不显示边框但是他使用的前提是在窗口没有执行任何显示的前提下才能实现 请问 有没有窗体已经显示出来的情况下 能够去掉边框的方法...... 解决方案 已经解决了,还是通过setUndecorated方法,用两个窗口实现 解决方案二

JS实现浏览器全屏和退出全屏

   测试环境:     [操作系统]: win7 64位     [IE]:IE9     [FireFox]: FireFox 29     [Chrome]: Chrome 34     众所周知,IE是个奇葩的浏览器,但是由于用户量很大,开发者还是不得不为IE考虑一下,于是,各种浏览器相关的操作,都要多一个特别的判断--专门针对IE浏览器的判断,这里的全屏也不例外.看代码: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2

android编程开发之全屏和退出全屏的实现方法_Android

本文实例讲述了android编程开发之全屏和退出全屏的实现方法.分享给大家供大家参考,具体如下: xml代码: <Button android:id="@+id/button5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/fullscreen" android:onClick

JS 全屏和退出全屏详解及实例代码_基础知识

JS 全屏和退出全屏 js实现浏览器窗口全屏和退出全屏的功能,市面上主流浏览器如:谷歌.火狐.360等都是兼容的,不过IE低版本有点瑕疵(全屏状态下仍有底部的状态栏). 这个demo基本是够了,直接复制下面的源码另存为html文件看效果吧. <!DOCTYPE html> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <

android设置全屏与取消全屏方法

android提供了两种方式来实现无标题栏和全屏效果,即通过xml文件声明的方式或在程序中动态控制的方式. android设置全屏方法 一.通过程序设置:  代码如下 复制代码     package com.hhh.changeimage:     import android.app.Activity;     import android.os.Bundle;     import android.view.Window;     import android.view.WindowMan

Android判断当前屏幕是全屏还是非全屏

先来看一个android屏幕全屏实现代码  代码如下 复制代码 @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.La