Pre-loader transitions

Ok…i see a lot of Flash sites that have their preloader transition to the main movie seamlessly…I was wondering how they do that. (It’s almost like the pre-loader and the main movie is one and the same!!

I think this may be what you are talking about but I could be getting you wrong!

Don’t start your actual flash movie until frame 2 and add this code in frame 1 of the main movie timeline:

if (_framesloaded >= _totalframes) {
gotoAndPlay(2);
} else {
gotoAndPlay(1);
}

simple as that just add a movie clip in frame one for a preloader animation! take for example my site which is still under construction:

<a href=http://www.danalu.com>www.danalu.com</a>

To start the movie after the preloader to a different scene just change it to this:

if (_framesloaded >= _totalframes) {
gotoAndPlay(“intro”);
} else {
gotoAndPlay(1);
}

Replace “intro” with the name of your movie remember keep these " " if you want it to be a scene or take them out for a frame number! If you want the preloader to go to the movie and stop after its done loading just put this:

if (_framesloaded >= _totalframes) {
gotoAndStop(2);
} else {
gotoAndPlay(1);
}

If you do not get what I am saying just reply back and I will explain more but this should work if you know at least kinda what your doing!

Hey dan,
I think I maybe wrong, but in the code:

   
if (_framesloaded >= _totalframes) {
gotoAndPlay("intro")  ;
} else {
gotoAndPlay(1);
}

Isn’t ** intro** the frame label? Or does it work for movie clips as well? =)

Hello Dan and Kirupa,

Thanks for your reply…i got the preloader concept, but what I am confused about is the ACTUAL transition ( like the end of the preloader animation morphs into the main movie. I hope I am explaining this right?!

know what I mean?

Hey Kirupa,
I just checked it out, and the “intro” can either be a scene name or frame name!

Wow, I learned something new today!

What happens in those sites is that the main movie starts out looking like the preloader scene. Once the preloader is done, it goes to the main scene without you noticing. THEN, until like frame 60 or so, it’s just transitioning into the main movie LOOK. (even though it’s been in the main scene for 60 frames so far)

If you don’t get it, just email me back at
[email protected]

or AIM me at brassmonkeyboy

hi, everybody . . .
i have a question which hopefully someone can help me out with . . .
i have several scenes in a movie, and in the first scene, i have this in the first frame:

if (_framesLoaded ==_totalframes) {
gotoAndPlay (20);
}

and in the second frame i have this:
gotoAndPlay (1);

ok, this works fine for the first scene, but when i go to another scene, the same code gets overlooked and it doesn’t check if the total frames were loaded. I am not sure what kind of stop and check function would allow this to happen . . .
I basically want a separate preloader for each scene . . .
so if scene 1 loads, all of the other scenes should be left alone until they are actvated . . .

any help would be greatlty appreciated…

thanks , , ,

I’ve left out tid bits of a/s as I’m doing this from my head… I’m sure you can figure out where to change what… it’s all pretty straight forward.

What you can do is check the number of frames in each scene. For the sake of this example lets say that scene 1 has 22 frames, scene 2 has 30 frames, scene 3 has 40 frames.

frame one
_framesloaded==33
gotoAndPlay(3);

frame two
gotoAndPlay(1);

scene 2
frame 23
_framesloaded==52
gotoAndPlay(25);

frame24
gotoAndPlay(23);

scene 3
frame 53
_framesloaded==92
gotoAndPlay(55);

frame 54
gotoAndPlay(53);

ect… the only thing to remember is to add together the total frames from the last scene to each new scenes preloader.

PS-There is an easier way of doing this as well, if you’re using flash 5.0… check out my explination in flash 5.0 action script forum about OnClipEvent. post questions there as to how to customize the movie clip to serve your needs.

Hey Bishop2001,
I believe that the code loads all the frames for all the scenes in the animation. If you want to load only each scene, you should specify Scene 1 and frame number in the place of _totalframes. For Scene 2, you would enter Scene 2 and the frames to load up to instead of _totalframes.

hmm… I thought I just said that. :wink: … thanks Kirupa!!

just for my confusions sake, is what hes wanting to do pretty much the same thing i asked in my intro to home page post where i gave an example of the estudio site? because this is a little more complex an explanation than i recieved, in those replies i was told that what actually happens is a preloader with a pause action untill you hit the enter button and then it finishes playing out the preloder and moves elements out of the way to reviel the page your wanting them to see. or in this case arwe we just not wanting the button intersect between the two?

i got another question regarding this preloader… lets say u have made a nice animation and u want the whole animation to be played everytime u klick those links “regardless if the mc is already loaded” and when its done playing it will go to the loaded mc…

u guys get it or do i need to explain in another way ?

please clarify!..Im too tired to understand the question…sorry…hehe

say it like this instead… on the first frame u got the loader, on the second frame u got the content. ok…
now the loader is in its own mc on frame1 and it contains sum kind of animation that plays while the content is loading.
when the content is done loading the animation will stop and the content will be shown…
now the next time u hit the link u already got the contet loaded so the “loading” animation on frame1 will only be visible for a short time…

lets say that the “loading” animation is 5 sec´s long and u wanna see those 5 sec´s everytime u hit that link b4 the content shows up, but when u already got the content loaded ur only gonna see a glimpse of the animation cos the script on frame 1 says goto frame2 if allframes are loaded…

the thing im trying to say is that i want ppl to see those 5sec´s of animation even if all the frames are loaded

u got me this time ?

u can see an example of this on www.2advanced.com
when u hit any of their links u gonna se an “loading” animation and that animation is always there even if u have loaded the content…

I got it this time…Ok well if the only thing you want is for the user to see the actual loader or any animation you want, make 2 scenes…the first scene is always the LOADER without the script…like a fake loader…its there but its not actually a loader, its the first scene of your movie!

ya but is the fakeloader containing any script at all ? or is it just the animation ? and then should the real loader be on frame2 ? i mean the movie is still gonna get loaded…