Another preloader question

I’ve completed the tutorial on O’Reilly’s site:

The script on frame 5 uses the _totalframes variable. I want to not use this, but take say first 400 frames of my flash video and then start playing. I’ve tried changing the values, but the preloader never advances to the movie, and loads all 3400k and then stops at 100%. Can someone let me know how I need to change this script to start streaming the movie at 400 frames.

// Specify how many frames to load before playing.
var loadAmount = _totalframes;

// If the required number of frames have finished loading…
if (_framesloaded == loadAmount) {
// …start the movie
gotoAndPlay(“beginMovie”);
} else {
// …otherwise, display the load status
// then go back and check load progress again.

// First, determine the loaded and total kilobytes.
loaded = Math.round(getBytesLoaded() / 1024);
total = Math.round(getBytesTotal() / 1024);
percent = Math.round((loaded/total) * 100);

// Display the loaded kb, total kb, and percentage of
// kb loaded in text fields.
bytesLoadedOutput = loaded;
bytesTotalOutput = total;
percentOutput = percent + “%”;

// Set the width of the loadBar to a percentage of
// the loadBarHousing.
loadBar._width = loadBarHousing._width * (percent / 100);

// Now go back and check load progress.
gotoAndPlay(“loading”);
}

Ok, how many frames does you movie have?

The easiest way is this :

Put this is Frame 1 of your movie

ifFrameLoaded (400) {
    gotoAndPlay (3);
}

In Frame 2 put

 gotoAndPlay (1)

perhaps on another layer have a movie clip which has “loading flashing”.

Another way is this - preloaders (as far as I know) load from frame 1 onwards.
So for example if your movie in total has 1200 frames, the first 400 is 1/3rd in total.

So in your initial script :

if (percent = 33) {
    gotoAndPlay (6);
}

that is assuming your 6th Frame is the start of the movie outside of the loading code.

Off the subject 3400k is a lot. Very few people will be bothered to sit through that especially on 56K or slower. Make sure yr pictures are compressed aswell as your sound. Use a sound editor to cut it up if necessary, make the graphics In flash if possible. Use actionscript rather than tweens if possible. All of these aspects help to decrease file size.

I try to keep even epic intros below 600k at the outset - most of my intros are usually around 200k.

Hope that helps.

Hi,

just change the bit that says :

var loadAmount = _totalframes;

for:

var loadAmount = 400;

It’s that what u r asking for?