Search tutorials
Here's how:
1.create blank keyframe in the main timeline.
2.create a movieclip you want to use as a loadbar, with a size you're happy with (if you don't want a loadbar, leave it blank).
3.create a dynamic text field (if you don't want a percentage readout, you can omit this) for the sake of the tutorial we'll give it a variable name of "counterpercent".
4. select the movieclip and add the following actions:
onClipEvent (load) { //set the status bar width to zero; _xscale = 0; } onClipEvent (enterFrame) { //calculate the load as a percentage; counter = math.floor(_parent.getBytesLoaded()/_parent.getBytesTotal()*100); _parent.counterpercent = counter+"%"; //if loaded, play; if (counter>=100) { _parent.play(); } else { //if not loaded, set the status bar width; _xscale = counter; } }
5. place the rest of your flash file in the next scene or next frame.
that's it.
The use of the "_parent" target allows the file to calculate its own size whether it has been loaded into another movie or not. the use of on EnterFrame means you don't have to start looping between frames. the rest is up to your own creativity...
» Level Basic |
Added: 2003-03-22 Rating: 8 Votes: 32 |
» Author |
code & design monkey |
» Download |
Download the files used in this tutorial. |
Download (2 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!