PDA

View Full Version : Multiple level game preloader questions



x0b
May 30th, 2007, 11:44 AM
Hi everyone :smirk:

I am relatively new to flash so please bear with me!

I have made a flash game that comprises of multiple .swf files which hold different levels of the game. It runs smoothly from my machine and the transitions between levels all work perfectly as you'd expect. I want to put the game on a website but have now run into the problem of preloading and waiting for each level to load when it is called upon.

Before I jump in at the deep end I want to get a few things clear in my head (I have searched but couldn't find the exact info I needed!)

Anyway, a couple of questions if you don't mind;

Is it possible to load the initial .swf file on it's own and then load others in the background whilst the player is playing the first level? (This way there would be no delay in loading the next level when the player completes level1) I would not need a preloader display bar for the background levels, each level should take more than 1 minute to complete which should be more than enough time for the next level to have loaded in the background.

Is it better for me to continually load the game in the background as multiple .swf files therefore reducing the initial load time it takes the player to start playing, as opposed to combing them all into one huge .swf and loading the whole thing at the start?

Can anyone point me in the direction of a tutorial that would suit what I want to do please? I have looked at a few but don't want to start adapting one until I know it can do what I want!

Thanks for any help offered!

randomagain
June 2nd, 2007, 03:04 PM
no one has replied because this is a common question.

you need a master swf, which loads in level1, then loads in level 2, etc

best option is have a MC for the swf to load into


this.lvl1container.loadMovie(lvl1.swf)

hence the simplest way to get lvl2 to load is have the code when you click play


this.lvl2container.loadMovie(lvl2.swf)

one thing to note is code such as "root.something" will be buggered up when you load swfs into one another...

there :P

nathan99
June 2nd, 2007, 07:52 PM
unless you use _lockroot - BUT I agree; references to _root should be avoided

x0b
June 8th, 2007, 10:39 AM
ok thanks for the replies! I did do a pretty in depth search to see what i could find out, but without knowing exactly what i needed to search for i found it quite hard to work it all out.

i'll have a crack at your suggestions, thanks :)