Search tutorials
Step Two: Initialise Variables
In the first frame on the timeline add these variables and values
a = getBytesLoaded();
b = getBytesTotal();
v = Math.floor(a/1024)+"kb";
z = Math.floor(b/1024)+"kb";
w = Math.ceil((a/b)*360);
The variables a and b are exactly what they say. The variables v and z are the variables a and b converted from bytes to kilobytes and converting to an integer. The value w is the proportion of bytesloaded to bytesTotal converted to an angle in degrees. This is the value we will use to move the needle through its travel. Back on the timeline add a new frame, frame 2 and add this code
gotoAndPlay (1);
This simply loops the loading animation so it can constantly be updated with renewed "bytesloaded" information.
| » Level Intermediate |
|
Added: 2003-05-19 Rating: 6.6 Votes: 30 |
| » Author |
| Cyclist, Snowboarder, Flash Designer Extrordinaire. |
| » Download |
| Download the files used in this tutorial. |
| Download (52 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!