• home
  • forum
  • my
  • kt
  • download
  • Preloader that Detects the Flash Version

    Author: 2007-06-14 10:59:27 From:

    Purpose:

    I recently started to play with flash and the first thing that I found out was that, our browsers can not always successfully detect if a user has the proper flash version installed. So, after taking a course and my instructor (Allan Kennedy - his site here) gave us an idea about how we would detect Flash version from within flash. Finally, I now can fully find out if my users are infact uptodate (up to current Flash 5 technology).

    Description:

    index.html:

    • Is the first page and has preloader.swf embedded in it.
    • Also include the following TAG in your index.html page:
      <_____ http-equiv="REFRESH" content="10; url=need_f.html">
      NOTE: Replace ____ with the word meta above.
    • If your browser stays on the 'index.html' page for more than 10sec, it will automatically move the user to the need_f.html page.

    preloader.swf:

    • Checks to see if what version of FLASH is being used by the client.

      FLASH 1, 2, 3: Will freeze on the index.html page until the meta tag will refresh the page and prompt the client to update.
      FLASH 4: When adding String objects in Flash 4 the syntax is different. Therefore (test = "4" + "4" = "8") which will freeze the user on this page(see below), and the meta tag will refresh the page and prompt the client to update.
      FLASH 5: When adding String objects in Flash 5, the syntax (test = "4" + "4" = "44") and this will pass the test and go to the FRAME Label "Passed" (see below). It will then get your main page's URL (currently index1.html).

    • Your main page should be called 'index1.html'

      NOTE: If you decide to change it from 'index.html' change the page name in the frame Labeled "PASSED".

    ActionScript:

    Frames:

    ActionScript (Frame1):

    ActionScript (cont.):

    Frame 1 ActionScript in detail:

    stop( );                 Stops from moving across the timeline.
    var test;                Creates a variable called 'test'
    test = "4" + "4";        In Flash 5 ONLY this is used to contatinate string objects together
    if(test == "44"){        If user has Flash 5 installed then this will be true.
                             In flash 5: "4" + "4" = "44";
                             In flash 4: "4" + "4" = "8"; (Flash 4 contatinates strings differently)
                             In flash 1,2,3; It will not make it this far
    gotoAndStop("Passed");   Only if Flash 5 Actionscripting is detected will it go to
                             the frame labelled "Passed", otherwise the user will be stuck
                             on this page (index.html).
    }                        Closes the 'if' block.
    

    If the user is stuck on the 'index.html' page for at least 10sec (remember the meta tag above), it will forward them to our 'need_f.html' page that will notify the user to update their plugin AND it will even take them to the plugin page.

    ActionScript (cont.):

    ActionScript(Frame "Passed");

    Frame 'Passed' Actionscript in detail:

    stop( );                            Stops from moving across the timeline.
    getURL("index1.html", "_self");     This is the actionscript command that loads our main website
                                        which is currently set to the page 'index1.html' into the SAME window that
                                        we where just in.
    

    PreLoader Layer:

    In the layer called: "PreLoader" I just placed in some basic animations that the user may see for the first 10 seconds or so. Nothing too fancy.



    This is the end of the tutorial. Hope you enjoyed it.

     

    » Level Basic

    Added: : 2000-12-29
    Rating: 7.93 Votes: 139
    Hits: 3135
    » Author
    I am currently employeed as a web developer, a teacher and have my own little company which I am just building. I teach Java programming and have just started to use Flash.
    » Download
    Download the files used in this tutorial.
    Download (25 kb)

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      3D (20)
      Math Physics (14)
      3rd Party (5)
      Navigation (60)
      Actionscripting (26)
      Optimization (16)
      Animation (32)
      Projector (9)
      Audio (46)
      Special Effects (112)
      Backend (25)
      Text Effects (65)
      Drawing (18)
      Tips and Techniques (41)
      Dynamic Content (25)
      Tricks (6)
      Games (66)
      Utilities (19)
      Getting Started (71)
      Video (10)
      Interactivity (21)
      Web Design (22)

    New

    Hot