PDA

View Full Version : Loading Bar Component


dean20007
03-28-2006, 06:59 PM
I am using a loading bar component as a preloader and it works to certain extent . Except that it doesnt display until roughly 75%. why does it not display earlier.

I am using the code from a tutorial (Apologies to the author but I have forgotten your name!) and as is follows

// Create a listener object event function. The progress bar is an object so it needs an object function to work
myProgressBarListener = new Object();

// 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 now as we donít need it any more
myProgressBar._visible =false ;

// In this example I have used the gotoandstop(); command because I want the movie to go to and stop at frame 2
gotoAndStop(2);

// Close the above function
};


// Declares a listener that detects when the progress component has loaded the movie and is complete. Then calls the function above: myProgressBarListener
myProgressBar.addEventListener("complete", myProgressBarListener);

// We are now setting the progress bar component variables
// Set up the progress bar component to polled when loading the movie. In this case it has to be set to polled to work
myProgressBar.mode = "polled";

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

// Set the conversion to 1. This basically means the component divides the current and total values loaded and to be loaded. Then it floors them (works out the difference between them) and displays the converted value in the label property
myProgressBar.conversion = "1";

// Set the label to display the word 'loading' followed by the percentage value loaded so far
myProgressBar.label = "LOADING %3%%";

// The direction the progress bar moves when loading
myProgressBar.direction = "right";

// The location of the label that displays the percentage loaded so far
myProgressBar.labelPlacement = "bottom";

// Stops the Movie at the current frame until the Movie has been preloaded
stop();

oldnewbie
03-28-2006, 07:21 PM
I've always hated that progressBar component....

Do you have other components in your movie, and/or attached movie clips and/or soundObjects with linkage set to export on the first frame, and/or embedding fonts?

dean20007
03-28-2006, 07:35 PM
http://www.gskinner.com/blog/archives/000104.html

this guy helped me out a treat......a schoolboy error but infuriating none the less