Flash full screen function test

Source: Internet
Author: User
Flash full screen function test
Online test page: http: // Www.klstudio.com/demo/as/fullscreen/fullscreen.html
Related documents: http: // Www.klstudio.com/demo/as/fullscreen/fullscreen.rar

< Div ID = " Flashcontent " > < / Div>
< Script Language = " Javascript " SRC = " JS/swfobject. js " > < / SCRIPT>
< Script Language = " Javascript " >
VaR Orginflash = {Init: False , Isfullscreen: False , Position: "" , Top: "" , Left: "" , Width: "" , Height: "" };
Function Writeflash (){
VaR So =   New Swfobject ( " Fullscreen.swf " , " Fplayer " , " 100% " , " 100% " , 8 , " # Ffffff " );
So. addparam ( " Quality " , " High " );
So. addparam ( " Swliveconnect " , " True " );
So. addparam ( " Menu " , " False " );
So. addparam ( " AllowScriptAccess " , " Samedomain " );
So. addparam ( " Allowfullscreen " , " True " );
So. Write ( " Flashcontent " );
}
Function Getscreensize (){
VaR W =   0 ;
VaR H =   0 ;
If ( Typeof (Window. innerwidth) =   ' Number ' ){
W = Window. innerwidth;
H = Window. innerheight;
} Else   If (Document.doc umentelement && (Document.doc umentelement. clientwidth | Document.doc umentelement. clientheight )){
W = Document.doc umentelement. clientwidth;
H = Document.doc umentelement. clientheight;
} Else   If (Document. Body && (Document. Body. clientwidth | Document. Body. clientheight )){
W = Document. Body. clientwidth;
H = Document. Body. clientheight;
}
Return {Width: W, height: H };
}
Function Fullscreen (){
If ( ! Orginflash. init ){
Orginflash. Position = Document. getelementbyid ( " Flashcontent " ). Style. position;
Orginflash. Top = Document. getelementbyid ( " Flashcontent " ). Style. Top;
Orginflash. Left = Document. getelementbyid ( " Flashcontent " ). Style. Left;
Orginflash. Width = Document. getelementbyid ( " Flashcontent " ). Style. width;
Orginflash. Height = Document. getelementbyid ( " Flashcontent " ). Style. height;
}
Orginflash. init =   True ;
Orginflash. isfullscreen =   True ;
VaR Screensize = Getscreensize ();
Try {
Document. getelementbyid ( " Flashcontent " ). Style. Position =   " Absolute " ;
Document. getelementbyid ( " Flashcontent " ). Style. Top =   " 0px " ;
Document. getelementbyid ( " Flashcontent " ). Style. Left =   " 0px " ;
Document. getelementbyid ( " Flashcontent " ). Style. Width = Screensize. Width + " Px " ;
Document. getelementbyid ( " Flashcontent " ). Style. Height = Screensize. Height + " Px " ;
Document. Body. style. Overflow = " Hidden " ;
Window. scrollto ( 0 , 0 );
} Catch (E ){
}
}
Function Normal (){
If (Orginflash. init ){
Orginflash. isfullscreen =   False ;
Try {
Document. getelementbyid ( " Flashcontent " ). Style. Position = Orginflash. position;
Document. getelementbyid ( " Flashcontent " ). Style. Top = Orginflash. Top;
Document. getelementbyid ( " Flashcontent " ). Style. Left = Orginflash. Left;
Document. getelementbyid ( " Flashcontent " ). Style. Width = Orginflash. width;
Document. getelementbyid ( " Flashcontent " ). Style. Height = Orginflash. height;
Document. Body. style. Overflow = " Auto " ;
} Catch (E ){
}
}
}
Function Resize (){
If (Orginflash. isfullscreen ){
Fullscreen ();
}
}
Window. onresize = Resize;
Writeflash ();
< / SCRIPT>

P.s.
1 Full Screen flash FunctionCodeSome references are provided on the Internet.
2 The full screen flash function is later than IE6 and Flash Player 7 . 0 or above can be run in a browser environment test!
3 The full screen flash function is implemented in two ways. The Flash Player version number is 9. 0.18 . 60 and above are implemented through Flash 9 internal code, while those earlier than this version are implemented through JS + Div!
4 Use the new Flash 9 function to implement full screen technology. Pay attention to the following points:
A. The Flash Player version must be 9.0 . 18 . 60 or later;
B. The code that calls the full screen function can be run only by triggering events, such as onpress and onrelease events;
C. when inserting HTML code, you must set < Param name = " Allowfullscreen " Value = " True "   / >;
D. Multiple studies have found that, for example, the HTML code is set < Param name = " Wmode " Value = " Opaque "   / > Or <Param name = "wmode" value = "Transparent" / > The full screen function is invalid! That is to say, the full screen function is valid only when the flash window module is set to window (this is my exclusive discovery) !  

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.