Page : 1 2 3

78. Select second frame of the action layer.

79. Select Insert > Keyframe.

80. Select Window > Actions.

81. In the Frame Actions window type the following Actionscript.



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.

82. Select third frame of the action layer.

83. Select Insert > Keyframe.

84. Select Window > Actions.

85. In the Frame Actions window type the following Actionscript.


gotoAndPlay (1);

86. Select third frame of all the layers.

87. Choose Insert > Frame.

88. Choose Insert > Scene.

89. Start your movie animation in this scene. Here we have kept movie page.

90. Choose Control > Test Movie.

91. Choose View > Show Streaming.

This will start showing loading animation and other information about how many bytes and kbytes are loaded.


As soon as the movie gets loaded the box will get filled totally with orange liquid and the movie will start playing the second scene.

Regards,

Manoj Kotak.
The author is Director of Image Online Pvt. Ltd. developer of
Layout Galaxy web site design templates for photoshop and Flash.

All accompanying logos, brands and product names are trademarks of their respective companies.

Blood for humans comes only from humans : Donate Blood
http://www.donate-blood.org   E-mail - om@donate-blood.org





© Image Online  2001-2003