This is very very old. it's about the NG preloader
we Will make it in 2 parts in the first we will use the NG preloader
and understand it
in the second we will learn how to make our own preloader
the main code of NG prelaoder is this:
_root.stop();
_root is referring to scene 1 out side this Movie clip
stop(); tells it to stop
PercentLoaded = _root.getBytesLoaded() / _root.getBytesTotal() * 100;
then they define a new variable named PercentLoaded which is equal to
_root.getbytesloaded() (all the bytes the main movie already loaded)
divided in _root.getbytestotal which is the amount of bytes in the
whole movie
if (PercentLoaded != 100) {
does a action if a condition happens that condition is that 100% of
the movie is NOT loaded (!=)
setProperty(bar, _xscale, PercentLoaded);
setproperty sets a property of a Movie Clip that property is it's x
scale (how wide it is) and it's value is the present loaded
} else {
if the last condition didn't happen
gotoAndStop("loaded");
go to a frame labeled loaded(that has the play button in it)
}
now we'll learn how to make a present preloader:
first create a new symbol and call it preloader
that symbol should be a Movie clip
then in this symbol create a text field and change it's properties to
"dynamic text" (newb3.jpg red arrow) and in the var section (newb3.jpg
blue arrow) put precentloaded
in the first frame of the Movie clip(where the text is) put
_root.stop();
PercentLoaded = _root.getBytesLoaded() / _root.getBytesTotal() * 100;
if (PercentLoaded == 100) {
_root.play();
}
it follows the same pattern as the ng preloader just remember to add a
second frame to the movie clip named prelaoder
Benjamin Gruenbaum