PDA

View Full Version : Preloader w/loadmovie calling a .swf to run in sync


Slave8
03-16-2006, 06:10 PM
Ok, by posting here you know I am a newbie. I have been getting along great in Flash then I decided I wanted to try something a bit more complicated and I am totaly stumped. Here's what I am trying to do:
1) have a scene with a preloader. easy enough right? I thought so too at first.
2) have the preloader place a 100 frame .swf (in a blank_mc) on the main stage
3) have that preloader swf play synced to load time (i.e. when 50% of the main content is loaded 50% of my loader swf will have played)
4) at 100% bytes loaded time go to the main content on frame 2 of the main movie

I just for some reason cannot figure out the logistics to make it all work. I have downloaded countless .fla files to try and disect them but none so far have helped. I can get the swf to load via loadmovie on the main stage but can't get it to play in sync with load time. And that in itself may be the wrong way to approch this. I guess it would be like a percentage preloader but insted of showing numbers or a loadbar it would play the swf. I am baffled.
Slave8

oldnewbie
03-16-2006, 06:48 PM
Your 100 frames movie should be a movie clip within your main movie, not loaded in...

Now, learn this about preloaders... The smaller the better, and only actionscripted is best.

What's the bytes count on that 100 frames movie?

If it's too heavy, you'll need to use a preloader to preload the preloader you want to use as a preloader for your main movie.

Slave8
03-16-2006, 07:19 PM
Well first of all thanks for the reply! Nixxing the load movie. Well the reason for the 100 frame movie was to give a 1-1 ratio of bytes to frames. I could make it 10 as well. The reason is I have a logo going from blurry at frame 1 to sharp at fram 80 and wanted the last 20 frames of the preloader stay sharp before moving to the main content. As it is right now the 100 frame movie is 16kb. The only thing in it is the logo and it can probably be trimmed down some more size wize. I was just trying to get the layout going and that was the first graphic I grabbed.I am closer than before. I belive I am over thinking this. Right now I have a simple script:

stop();
onEnterFrame = function(){
percent_loaded = (_root.getBytesLoaded()/_root.getBytesTotal());
loader.value = percent_loaded;
if (percent_loaded == 1){
delete onEnterFrame;
gotoAndPlay(3);

}
}

on frame 1 of my main movie. My preloader is still at the moment 100 frames and when I test everything runs as planned execpt the preloader is not syncing (i.e. playing all 100 frames before jumping to my content on frame 3 of the main movie). So I am guessing I need a math.round or something to have it play in sync with bytes downloaded. Gonna look into that.

Slave8
03-17-2006, 04:49 PM
For anyone trying to do what I had describe above I found this tute that explains everything I was asking!
http://www.gmg.com.au/assets/tutorials/flash-mx-loader/index.html
A great tutorial and with tweeking the code you can really learn what's going on. I got my loader movie down to 1.6k and it plays in sync with all download speeds. Sweet. Thanks for the help Oldnewbie and making me think out and understand the princilpe behind using a preloader in the first place.