00:00
00:00
Newgrounds Background Image Theme

Mekatov just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As: Analyzing The Ng Preloader

1,486 Views | 3 Replies
New Topic Respond to this Topic

As: Analyzing The Ng Preloader 2005-06-28 13:43:33


AS: Main

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

Response to As: Analyzing The Ng Preloader 2005-06-28 13:45:34


Hmm... it seems that AS threads are very popular today. Anyways, nice post inglor!

Response to As: Analyzing The Ng Preloader 2005-06-28 14:55:38


ty ;)

this whole thing happened not too long ago, with no offense to ludy (the as codes here thread was a great tool) this is cleaner, better and more efficient

Response to As: Analyzing The Ng Preloader 2005-06-28 15:16:57


At 6/28/05 02:55 PM, Inglor wrote: ty ;)

this whole thing happened not too long ago, with no offense to ludy (the as codes here thread was a great tool) this is cleaner, better and more efficient

Indeed it is...