smerbie
02-25-2006, 05:54 AM
I am creating a dynamic photo gallery. The gallery will be broken into 3 categories for each set of photos. I want each category to be in its own movie clip. When I click on each photo thumbnail, I want its full size photo to preload before it appears. I am using the progressBar component and the scrollPane component to accomplish this (I built this from a tutorial). The preloader works great when everything is on Scene 1 (I built this on the main scene to test it.) but when I move everything inside of a movie clip which I'll call "webGallery" the photos still load but the preloader does not work anymore. Thanks in advance! (Flash MX 2004 Pro - publishing SWF as Player 6, A.S. 2.0)
I have included the actionscript below:
// Create a listener object event function. The progress bar is an object so needs an object function to work
myProgressBarListener = new Object();
// When the progress bar is complete and has preloaded the Scroll Pane component content, 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;
// Closes the above function
};
// Set the location of the content to be loaded
large.contentPath = loadMovie(place+".jpg", "large");
// Declares a listener that detects when the progress bar component has loaded the loader component content and is complete. Then calls the function myProgressBarListener
myProgressBar.addEventListener("complete", myProgressBarListener);
// Set up the progress bar component variable to polled mode.
myProgressBar.mode = "polled";
// The location of the Scroll Pane Component
myProgressBar.source = "large";
// Sets 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";
// Stop the movie at the frame until the move has been preloaded
stop();
I have included the actionscript below:
// Create a listener object event function. The progress bar is an object so needs an object function to work
myProgressBarListener = new Object();
// When the progress bar is complete and has preloaded the Scroll Pane component content, 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;
// Closes the above function
};
// Set the location of the content to be loaded
large.contentPath = loadMovie(place+".jpg", "large");
// Declares a listener that detects when the progress bar component has loaded the loader component content and is complete. Then calls the function myProgressBarListener
myProgressBar.addEventListener("complete", myProgressBarListener);
// Set up the progress bar component variable to polled mode.
myProgressBar.mode = "polled";
// The location of the Scroll Pane Component
myProgressBar.source = "large";
// Sets 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";
// Stop the movie at the frame until the move has been preloaded
stop();