PDA

View Full Version : random loading



telegirl
September 18th, 2003, 09:13 PM
Hi,

I'm working in Flash 5...I've made a random loading database of animations that's the first thing to load in my movie. My problem is that after the random images fade in, display, and then fade out I need the next movie clip to load. Right now I can't figure out how to get the second movie clip to load Following the random loading movie clips...all the other animations want to play at the same time the random movie clip plays. I used a modified version of the Kirupa random loading background...it's on the timeline as "Location" with the action scripting for the random load on that layer. Can anyone tell me how how get the second animation to play After the random loading clips play?

This is the random loading script I'm using...

choice = Math.round(Math.random()*2);
if (choice == 0) {
location.loadMovie("quote0.swf");
break;
} else if (choice == 1) {
location.loadMovie("quote1.swf");
break;
} else if (choice == 2) {
location.loadMovie("quote2.swf");
break;
}

Thanks,
Telegirl

ahmed
September 18th, 2003, 09:17 PM
your code is unneccesarily(sp?) long..

choice = Math.round(Math.random()*2);
location.loadMovie("quote"+choice+".swf");

do all the movies have the same number of frames..?

Yeldarb
September 18th, 2003, 09:20 PM
AS WITDRAWN BECAUSE IT WOULDN'T WORK (well... it would... but it wouldn't give the desired effect...)

ahmed beat me to it, and had better code... :thumb: lol

ahmed
September 18th, 2003, 09:22 PM
lol

what's the point of loading the very same movie into the very same holder every frame..? that doesn't quite do it Yeldarb :)

telegirl
September 18th, 2003, 09:29 PM
Sorry, maybe I wasn't clear in my initial post. The script I posted works fine...that's for loading the random movie clips. My problem is that once a random clip has played I have a totally different movie clip I want to play After whichever random clip has played. I can't figure out how to do that. Maybe if I explain it like this...the splash page opens with a background and an animated quote movie clip plays...after the animated quote fades I want the animation for the website name to come onto the stage. It's figuring out how to get the animated clip for the website name to come in After the animated quote is done playing. I hope that helps...

Yeldarb
September 18th, 2003, 09:32 PM
at the end of each movie clip tell it to play the other one
on the last frame put


onEnterFrame = function() {
_root.name._visible = true;
_root.name.play();
this.unloadMovieClip();
}

i think this will work... right ahmed?

telegirl
September 18th, 2003, 10:09 PM
Okay, I tried putting that in the last frame of each of the random loading movie clips, inserting the movie clip name where the code says "name" for the next movie clip I want to load. It didn't work....maybe I did something wrong? All the animations are still playing at the same time on top of each other. :-(

Yeldarb
September 18th, 2003, 10:22 PM
try making them not visible in the first frame of your movie (and stopped)

telegirl
September 18th, 2003, 10:30 PM
I don't know how to do that...

Yeldarb
September 18th, 2003, 10:35 PM
on the first frame put _root.themovieclipsinstancenames._visible = false;

on the first frame of the movieclips put stop();

telegirl
September 18th, 2003, 10:53 PM
I'm sorry, I don't understand...the first frame of what? And, the frist frame of which movie clips, the ones from the random loading part or the movie clips I want to follow those?

I'm really remedial at this...

Yeldarb
September 18th, 2003, 10:58 PM
first frame of the movie
the movie clips you're trying to play after the random ones

telegirl
September 18th, 2003, 11:09 PM
Okay, I've tried all that and none of it has done any good at all...everything's still loading all at once on top of each other.

Yeldarb
September 18th, 2003, 11:24 PM
will u upload an fla?

telegirl
September 19th, 2003, 11:05 PM
I've uploaded the fla for the movie plus the fla's for the 3 sample random loading images...

http://www.hawaiiancow.com/flash_files2.html

The order I'd like the animations to load is as follows...when the page opens I want the random loading quote image to fade in, display, and then fade out. After that I want the animation "Hawaiian Cow Welcomes You" to come onto the stage and then stay visible after that bit of animation runs. Following that I want the "udder construction" animation to fade in and stay visible.

Thanks for having a look. :-)