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>

(0)

相关推荐

  • vue-video-player 通过自定义按钮组件实现全屏切换效果【推荐】

    最近公司的产品上线,一些高级功能在基础版本中不对用户开发,通过视频的形式展示. 产品开发用的是 vue, 经同事介绍使用了vue-video-player视频播放插件,通过 demo案例很快实现了视频播放效果 <video-player class="vjs-custom-skin" ref="videoPlayer1" :options="playerOptions" :playsinline="true" :even

  • JS 全屏和退出全屏详解及实例代码

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

  • Android开发之全屏与非全屏的切换设置方法小结

    本文实例讲述了Android开发之全屏与非全屏的切换设置方法.分享给大家供大家参考,具体如下: 静态方法 1. 代码方式 在Activity类OnCreate方法中设置,代码如下 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().se

  • Android 应用的全屏和非全屏实现代码

    Android 应用的全屏和非全屏实现代码 全屏显示操作: /** * 全屏显示 */ private void setFullSreen() { WindowManager.LayoutParams params = getWindow().getAttributes(); params.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; getWindow().setAttributes(params); getWindow().addF

  • 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之切换全屏和退出全屏实现代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 应用场景: 比如很多网页游戏全屏之类的,或者是网上看小说等. 核心代码: //控制全屏 function enterfullscreen() { //进入全屏 $("#fullscreen").html("退出全屏"); var docElm = document.documentElement; //W3C if

  • js全屏事件fullscreenchange 实现全屏、退出全屏操作

    本文实例为大家分享了js全屏事件fullscreenchange,实现全屏.退出全屏操作,供大家参考,具体内容如下 1.进入全屏 function launchFullscreen(element) { if (element.requestFullscreen) { element.requestFullscreen() } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen() } else if (el

  • Android全面屏与异形(刘海)屏的适配教程

    写在前面 Android全面屏的手机越来越多了,要开始考虑应用适配全面屏的问题了,查了查相关文章,总结一下. 声明最大屏幕宽高比 以上图片来自Google Developer 通过文档可以看出从Android7.0开始,应用的多窗口模式默认变为启动,在多窗口模式下,默认已经进行了全面屏适配,如果我们不想应用在多窗口模式下运行,可以修改以下属性: android:resizeableActivity="false" 此时,我们可以手动进行设置最大屏幕宽高比: android8.0及以上:

  • iOS实现视频播放全屏和取消全屏功能

    本文实例为大家分享了iOS实现视频播放和取消全屏功能具体代码,供大家参考,具体内容如下 iOS 视频播放全屏和取消全屏功能实现,所需全屏的视频所在的vc需要导航控制器控制 自定义 全屏vc VedioPlayerViewController 并定义属性 /// 自定义的那个视频类 ///@property (nonatomic,strong) VedioPlayer *vedioPlayer; 在VedioPlayer中定义属性 ///视频展示的view 的父视图 @property (nona

  • vue-video-player 解决微信自动全屏播放问题(横竖屏导致样式错乱问题)

    对于vue-video-player,从github上找到一段代码,直接放页面!可以了,视频展示出来了!开始下一个功能.... 这可能是大部分前端开发者一贯的思维模式,拿来一个插件,看着demo就做出来了,功能展示正常就OK了,但是一旦出了bug,就会面向百度编程或者面向Google编程! 其实,我也是这样的,哈哈哈哈..... 废话不多说,最近在做一个视频播放的功能,找到vue-video-player插件后,咔咔咔完事,拿着我的爱疯,完美演绎!但是其他人的国产某牌手机,展示的完全不一样,打开

随机推荐