PDA

View Full Version : Preloader Problems


mrmyers
05-02-2004, 01:58 PM
Hello.

I am having preloader issues! Inside the my preloader I have a movie clip which will repeat itself until the content is fully loaded and then of course the timeline will move on. The repeating clip simulates drops of water with a ripple effect in the pond below. My problem is that once the content is fully downloaded, the clip ends immediately and the timeline moves on. This looks terrible because the ripples in the pond need to fully dissapate in order to proceed seemlessly.

Once the content is fully downloaded, is there a way to allow the clip (if it is in the middle of playing) to play itself out before allowing the rest of the timeline to move on? The preloading script I am currently using can be found at:

http://www.gmg.com.au/assets/tutorials/flash-mx-loader/index.html

If I need to use another script that would be fine with me. If this is too vague of a description, please let me know. Thank you for your help!

Cyanide
05-02-2004, 05:23 PM
All you need is a way to check if the pond ripples movie clip is on its last frame. So something like this:

if(getBytesLoaded()/getBytesTotal() == 1 && ripples._currentframe == ripples._totalframes) {
_root.gotoAndPlay(2)
}

mrmyers
05-02-2004, 09:00 PM
O.K., here is the code which is attached to my preloader MC entitled, "loading".

onClipEvent (load) {
if(getBytesLoaded()/getBytesTotal() == 1 && drip._currentframe == drip._totalframes) {
_parent.play();
} else {
preLoad = (_parent.getBytesTotal() * 0.75); //percent to preload
}
_parent.stop();
}

onClipEvent (enterFrame) {
gotoAndStop(loadedIndicatorFrame());
if (quickPlay == true) { //quickly play the anim
if (_currentframe == _totalframes) {
_parent.play();
}
} else { //wait for the preload
if (_parent.getBytesLoaded() >= preLoad) {
_parent.play();
}
}
}

The ripples MC is entitled "drip" and rests inside the "loading" MC. This ammendment to the script seems to have no effect, positive or negative on the functioning of the preloader. It still ignores the fact that I want the "drip" MC to run its course before moving on. Am I addressing the "drip" MC incorrectly somehow, seeing as how it is nested inside the preloader MC? Thanks again for your help!

Cyanide
05-03-2004, 01:19 AM
Try this.
onClipEvent (enterFrame) {
gotoAndStop(loadedIndicatorFrame());
if (quickPlay == true) { //quickly play the anim
if (_currentframe == _totalframes) {
_parent.play();
}
} else { //wait for the preload
if (_parent.getBytesLoaded() >= preLoad && drip._currentframe == drip._totalframes) {
_parent.play();
}
}
}
The part I edited is the part you said was waiting for the preload. So you want it to wait until it's at least 75% preloaded and the "drip" MC is on it's last frame, then advance the timeline.

mrmyers
05-03-2004, 10:48 PM
Thank you very much for your time and your help. It worked great! :D