Flash Open Full Screen window

Source: Internet
Author: User
Tags implement

Difficulty: Intermediate
Software Environment : Flash 4 or 5, NS or IE 4 or higher.

We have a lot of requirements in this example, but I'm not a javacscript programmer, so I asked people to do it in a Web page. Most people think the full-screen screen is annoying, so we've come up with a lesson: never implement it when you don't need it, because it's annoying, isn't it? All right, let's go.

We want to paste the code into our HTML file. I made minor changes to this code to allow us to do this.

Many of the messages I receive often contain the following two common errors:

    • When you publish an HTML file in Flash, you overwrite the contents of the previous HTML file, so you publish the HMTL file and then paste the code.
    • If there is no effect, clear the temporary files in IE.
    • If you use an Apple browser, check the bottom of the page for a note.

You need to do two simple steps to get the Full-screen window to pop up:

  1. Copy and paste the following code between the
    <script language= "JAVASCRIPT" >

    <!--

    function Detectversion ()
    {
    Version = parseint (navigator.appversion);
    return version;
    }

    function Detectos ()
    {
    if (navigator.userAgent.indexOf (' Win ') = = 1) {
    OS = ' Macintosh ';
    } else {
    OS = ' Windows ';
    }
    return OS;
    }

    function Detectbrowser ()
    {
    if (navigator.appName.indexOf (' Netscape ') = =-1) {
    Browser = ' IE ';
    } else {
    Browser = ' Netscape ';
    }
    return browser;
    }

    function fullscreen () {

    var adjwidth;
    var adjheight;

    if ((detectos () = = ' Macintosh ') && (detectbrowser () = ' Netscape ')) {
    Adjwidth =;
    Adjheight = 35;
    }
    if ((detectos () = = ' Macintosh ') && (detectbrowser () = ' IE ') {
    Adjwidth =;
    Adjheight = 35;
    Winoptions = ' fullscreen=yes ';
    }
    if ((detectos () = = ' Windows ') && (detectbrowser () = ' Netscape ')) {
    Adjwidth =
    Adjheight = 30;
    }
    if (Detectversion () < 4) {
    Self.location.href = ' oldbrowser.html ';
    } else {
    var winwidth = Screen.availwidth-adjwidth;
    var winheight = screen.availheight-adjheight;
    var winsize = ' width= ' + winwidth + ', height= ' + winheight;
    var Thewindow = window.open (' windowversion.html ', ' windowname ', winsize);
    Thewindow.moveto (0,0);
    }
    }

    function Makeitso () {
    if ((detectos () = = ' Windows ') && (detectbrowser () = = ' IE ')) {
    window.open (' thefullscreen.html ', ' windowname ', ' fullscreen=yes ');
    } else {
    Onload=fullscreen ();
    }
    }
    -->


    </script>


  2. Change the following two lines of HTML file for the window you want to pop up.
    var Thewindow = window.open (' windowversion.html ', ' windowname ', winsize); --Line 50
    and
    window.open (' thefullscreen.html ', ' windowname ', ' fullscreen=yes '); --Line 56
  3. Changing the following file is a question that prompts you to have an older browser version. (Translator: Basically no use, ignore it)
    self.location.href = ' oldbrowser.html '; --Line 46
  4. Create a button in your Flash file and add the following action:
    On (release) {
    GetURL ("Javascript:makeitso ()");
    }

Notice that the Full-screen window we need to eject is implemented in JavaScript. If you need to implement a different button by defining variables to achieve a full screen of different windows, this tutorial will not be written, if you need to, to the forum, we will help solve.

Appendix:

How to achieve a full-screen effect without a scroll, it's easy to set the scroll bar to None, as follows:

<body bgcolor= "#FFFFFF" text= "#000000" scroll= ' no ' >


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.