loadedbytes =
getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes
== totalbytes) {
nextScene
();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.mainloader.loader)
{
gotoAndStop
(_root.frame);
}
//loadedbytes
= getBytesLoaded();
'loadedbytes' collects the value of bytes loaded with the
help of the 'getBytesLoaded()' function.
This value gets stored in the dynamic text field carrying
variable name 'loadedbytes'.
//totalbytes
= getBytesTotal();
'totalbytes' collects the value of totalbytes included in
the movie(total size of the movie in bytes) with the help
of the 'getBytesTotal()' function.
This value gets stored in the dynamic text field carrying
variable name 'totalbytes'.
//loadedkbytes
= Math.ceil(loadedbytes/1000);
'loadedkbytes' collects the nearest value of kbytes loaded
with the help of the 'Math.ceil(loadedbytes/1000)' function.
This value gets stored in the dynamic text field carrying
variable name 'loadedkbytes'.
//totalkbytes = Math.ceil(totalbytes/1000);
'totalkbytes' collects the value of totalkbytes included
in the movie(total size of the movie in kbytes) with the
help of the 'Math.ceil(totalbytes/1000)' function.
This value gets stored in the dynamic text field carrying
variable name 'totalkbytes'.
//if
(loadedbytes == totalbytes) {
nextScene ();
}
This condition checks if the loadedbytes get equaled to
the totalbytes of the movie,the next scene will start playing.(i.e.
Scene2)
//frame =
int(loadedbytes/(totalbytes/100));
The dynamic text field carrying variable name 'frame' collects
the integer value of bytes loaded in percentage form.
//tellTarget
(_root.mainloader.loader) {
gotoAndStop (_root.frame);
}
This action
is defined to control the loader with the percentage value
getting in the 'frame' variable.
The loading animation of 100 frames in the box movie clip
is interlinked with the percentage loaded in the frame varible.