- Go to the movie clip "Loadbar"
- Create a new layer and rename it "Actions"
- Drag the dot in the timeline on Layer 1 so that it spans frame 1 and 2.
- In the Actions layer put a keyframe on rame 1 and 2. (Do so by clicking on the empty frame and pressing F6)
- Goto the keyframe in frame one of the Actions layer and double click bringing up the actionscript editor.
- In the actionscript window place the following code...
setProperty(this, _xscale, (_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
Note : ".getBytesLoaded()" and ".getBytesTotal()" are both located in Objects - > MovieClip in the left hand chooser in the action script window or by clicking on the plus symbol in the action script window.
What this does is that it finds the percentage of the movie loaded ( root.getBytesLoaded() / root.getBytesTotal() ) at that point and multiplies it by 100... We multiply it by 100, other wise the movie clip would range between 0 and .01 * the width of the movie clip.
|» Level Intermediate|
Rating: 8 Votes: 452
|No details available.|
|Download the files used in this tutorial.|
|Download (43 kb)|
|More help? Search our boards for quick answers!|