Preload External Flash Movies with Components

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Tutorial - Preload External Flash Movies with Components

 

Free Flash Tutorial


Step 5    <<   Previous      Intro   1   2   3   4   5   6     Next   >>       >>   Webwasp Mates

 

Step Five: The ActionScript Layer - Frame 1

  1. Select Frame 1 of the layer: ActionScript
  2. Add this code (if you wish leave out the gray comments):

    // Create a new Object. The Progress Bar is an object so needs an object function to work
    myProgressBarListener = new Object();

    /* Create a listener object event function. When the Progress Bar is complete and has preloaded this Movie, the listener will call and run this code below:   */
    myProgressBarListener = function (eventObject) {

    // Hide the Progress Bar - we don’t need it any more as the Movie has now loaded
    myProgressBar._visible = false;

    // Remove the listener
    myProgressBar.removeEventListener("complete", myProgressBarListener);

    // Ends the function
    };

    // Declares a listener. This detects when the Progress Component has loaded the Movie. Then when the preloading is complete it calls the function myProgressBarListener
    myProgressBar.addEventListener("complete", myProgressBarListener);

    // Set up the Progress Bar Component to polled when loading the Movie. This will give a polled look to the Progress Bar as it loads. It has to be set to polled to work
    myProgressBar.mode = "polled";

    // Set the location to load as this Movie.
    myProgressBar.source = "_root";

         

Step 5    <<   Previous      Intro   1   2   3   4   5   6     Next   >>       >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

33892 visitors to this page since Oct 05 •

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.