Step 1 | |
I then selected the progress bar and hit F8 to make it a movie clip. Make sure the registration point is set as below. Why? Well... because we want the progress bar to fill from left to right!
In the Properties panel, name your progress bar preloader:
On Frame 1 of the Stroke layer, I inserted a keyframe and drew the following rectangle:
The above is just a stroke with no fill. The Stroke layer is above the Progress Bar layer. Why did we do it this way? Its quite simple really - we want the progress bar to fill within the stroke area. If we added a stroke to the progress bar itself, it wouldn't look right! On Frame 1 of the Text layer I inserted a keyframe and added a text box as follows: I then selected the text box and on the Properties panel I set it to Dynamic Text and named it loadText: | |
I highlighted the important pieces in the script. "preloader" was the name we gave the progress bar. "loadText" was the name we gave the text box. And "200" was the pixel width of the progress bar.
| |
What this script is saying is if the bytes that have been loaded equals the total number of bytes in the file then the preloading is done and you can go to frame 3 and begin playing the animation. If the bytes loaded does not equal the total then go back to frame 1 and keep preloading. NOTE: You may be asking why frame 3 has blank frames for the Text, Stroke, and Progress Bar layers. This is because we don't want the preloader to display once the actual animation is playing, which begins on frame 3. Also, you may not even see your preloader display if your file size isn't that big. What you could do is add a few more objects to your design and then go to Control > Test Movie. The flash player should appear and your movie will play. On the Flash player menu go to View > Download Settings and choose the slowest setting. Then test the movie again and you should see your preloader working. |
No comments:
Post a Comment