Flex Full Screen component part full screen implementation code _flex

Source: Internet
Author: User
Tags addchild
Let's publish the current code that adds a full screen to a particular component:
Copy Code code as follows:

<?xml version= "1.0" encoding= "Utf-8"?>
<mx:application xmlns:mx= "Http://www.adobe.com/2006/mxml" layout= "Absolute" >
<mx:titlewindow x= "113" y= "width=" 337 "height=" 263 "layout=" absolute "id=" titletest "title=" "single control Full Screen test" >
<mx:videodisplay x= "0" y= "height=" "160" width= "317" id= "Videodisplay"/>
<mx:button x= "134.5" y= "label=" full Screen "id=" Btnfullscreen "click=" fullscreen (); "color=" #F41131 "/>
<mx:button x= "134.5" y= "label=" full Screen "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 = ' full screen! ';
Fullscreenutil.exitfullscreen ();
}else{
Btnfullscreen.label = ' exit full screen! ';
Fullscreenutil.gofullscreen ();

Add the image to the full screen. Videodisplay
Fullscreenutil.addchild (Videodisplay, True, true, true);

Place the Btnfullscreen on the full screen image.
Fullscreenutil.addchild (Btnfullscreen, True, True, false,-1,-1,-1, 100);
}
}
]]-->
</mx:Script>
</mx:Application>

The following operations are used in full screen class:
Please download here:
http://download.csdn.net/source/1679251
And, of course, modify the HTML module file, as follows:
Copy Code code as follows:

<!--saved from Url= (0014) about:internet-->

<!--
Smart developers always View Source.

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

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

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

<body scroll= "No" >
<script language= "JavaScript" type= "Text/javascript" ><!--
Version Check for the Flash player this 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 are complete if installation is required
var Mmplayertype = (Isie = = True)? "ActiveX": "PlugIn";
var mmredirecturl = window.location;
Document.title = Document.title.slice (0) + "-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",//Join this line of code to allow full screen display!
"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 is 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"//Join this line of code to allow full screen display!
Type= "Application/x-shockwave-flash"
Pluginspage= "Http://www.adobe.com/go/getflashplayer" >
</embed>
</object>
</noscript>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.