How to Make a Flash Video Preloader Using Flash
Create the “loading bar” and the “dynamic text field”., Open a new Flash document., Select the Rectangle tool (R) and block the Outline color., Select the rectangle by clicking on it with the Selection tool (V)., In the dialog window that appears...
Step-by-Step Guide
-
Step 1: Create the “loading bar” and the “dynamic text field”.
Call the first layer loading bar. , Draw a 150 by 5 pixel rectangle and center it on stage.
Adjust these values by entering them in the appropriate fields in the Properties panel.
You’ll find the width (W) and height (H) input fields in the bottom left part of the aforementioned panel. , Select Modify > Convert to Symbol to make a movie clip out of your rectangle. , In the registration portion of the Convert to Symbol window, click the middle left rectangle. , Call it loading Bar. ,,, Go to the Properties panel once again, and select the following properties for your text field:
Set the type to “Dynamic text”.
Select “_sans” as font type (it should be on top of the fonts list).
Select the “central alignment” for your text field.
Select the “Use device fonts” option.
Leave the “selectable text” option turned off. , Hit Esc to exit text editing mode. , Call it bytesDisplay. ,,,, Draw a borderless square with the Rectangle tool (R) by holding Shift while clicking and dragging your mouse.
Rotate the square by 45 degrees with the Free Transform tool (Q).
Select the Line tool (L) and draw a line from the square’s left to its right point.
To do this exactly from edge to edge, be sure to have the Snap to objects option turned on (the small magnet icon at the bottom of the Tools panel).
By using the Selection tool (V), select the upper portion of the rectangle and hit Delete.
Select the line and erase it too. ,,,,,,,, Leave all the properties for the dynamic text field the same as they were for the first one you created.
Just make a small adjustment: set the alignment for the text field to left. ,,, Place it where the “blue triangle” points at the “loading bar’s” left edge. ,,, Make a new layer on top of all the existing ones and call it content. ,, The best thing to simulate content is an image.
Select File > Import > Import to Stage.
Select the picture you want to import and click Open.
The picture will appear on your main scene. ,,, Enter the following ActionScript code inside it: stop(); loadingBar._xscale = 1; var loadingCall:
Number = setInterval(preloadSite, 50); function preloadSite():
Void { var siteLoaded:
Number = _root.getBytesLoaded(); var siteTotal:
Number = _root.getBytesTotal(); var percentage:
Number = Math.round(siteLoaded/siteTotal*100); loadingBar._xscale = percentage; percentClip.percentDisplay.text = percentage + "%"; percentClip._x = loadingBar._x + loadingBar._width; bytesDisplay.text = "loaded " + siteLoaded + " of " + siteTotal + " bytes"; if (siteLoaded >= siteTotal) { clearInterval(loadingCall); gotoAndStop(5); } } , The site will load instantly, of course, because it loads straight from your hard disk and not from some web server. , This will set the simulated speed of download to a standard (slow) 56K modem. , You will now see the preloader at work! -
Step 2: Open a new Flash document.
-
Step 3: Select the Rectangle tool (R) and block the Outline color.
-
Step 4: Select the rectangle by clicking on it with the Selection tool (V).
-
Step 5: In the dialog window that appears
-
Step 6: select Movie clip as type and call it blue loading bar.
-
Step 7: With your newly made movie clip still selected on stage
-
Step 8: go to the left side of the Properties panel below the scene and assign it an Instance name.
-
Step 9: Lock this layer.
-
Step 10: Make a new layer and call it "bytes info".
-
Step 11: Select the Text tool (T).
-
Step 12: Click and drag out a text field just below the loading bar.
-
Step 13: Give this field an Instance name
-
Step 14: otherwise you won’t be able to tell it what to display via “ActionScript” commands.
-
Step 15: Lock this layer.
-
Step 16: Create the text field with percentage information that is going to be animated.
-
Step 17: Make a new layer and call it arrow indicator.
-
Step 18: Draw a small triangle just above the loading bar’s left edge.
-
Step 19: With the triangle still selected
-
Step 20: press F8 (or select Modify > Convert to Symbol) to convert it to a movie clip.
-
Step 21: Call it moving percentage field and make sure that the registration point is on its left middle side.
-
Step 22: Double-click on the newly made movie clip on stage to enter inside it.
-
Step 23: Call this layer "arrow".
-
Step 24: Select the triangle drawing and move it so that its bottom point is centrally aligned below the movie clip’s registration point.
-
Step 25: Lock this layer.
-
Step 26: Make a new layer above it and call it "text field".
-
Step 27: Select the Text tool (T)
-
Step 28: click and drag to create a small text field just above the triangle.
-
Step 29: Give this text field an Instance name: call it "percentDisplay"
-
Step 30: and lock this layer.
-
Step 31: Click on the Scene 1 link above the layers to return to the main scene.
-
Step 32: Use the arrow keys to adjust the position of the moving percentage field movie clip.
-
Step 33: Give this movie clip an Instance name: call it percentClip.
-
Step 34: Lock this layer.
-
Step 35: Place in the site content.
-
Step 36: Right-click frame 5 of this layer and select Insert “Keyframe” from the menu.
-
Step 37: Place some content here now.
-
Step 38: Make a new layer and call it actions.
-
Step 39: Select the first keyframe of this layer by clicking on it.
-
Step 40: Press F9 (or select Window > Actions) to open the Actions panel.
-
Step 41: Test your movie by selecting Control > Test Movie.
-
Step 42: Still in test movie mode
-
Step 43: select View > Download Settings > 56K.
-
Step 44: Select View > Simulate Download.
Detailed Guide
Call the first layer loading bar. , Draw a 150 by 5 pixel rectangle and center it on stage.
Adjust these values by entering them in the appropriate fields in the Properties panel.
You’ll find the width (W) and height (H) input fields in the bottom left part of the aforementioned panel. , Select Modify > Convert to Symbol to make a movie clip out of your rectangle. , In the registration portion of the Convert to Symbol window, click the middle left rectangle. , Call it loading Bar. ,,, Go to the Properties panel once again, and select the following properties for your text field:
Set the type to “Dynamic text”.
Select “_sans” as font type (it should be on top of the fonts list).
Select the “central alignment” for your text field.
Select the “Use device fonts” option.
Leave the “selectable text” option turned off. , Hit Esc to exit text editing mode. , Call it bytesDisplay. ,,,, Draw a borderless square with the Rectangle tool (R) by holding Shift while clicking and dragging your mouse.
Rotate the square by 45 degrees with the Free Transform tool (Q).
Select the Line tool (L) and draw a line from the square’s left to its right point.
To do this exactly from edge to edge, be sure to have the Snap to objects option turned on (the small magnet icon at the bottom of the Tools panel).
By using the Selection tool (V), select the upper portion of the rectangle and hit Delete.
Select the line and erase it too. ,,,,,,,, Leave all the properties for the dynamic text field the same as they were for the first one you created.
Just make a small adjustment: set the alignment for the text field to left. ,,, Place it where the “blue triangle” points at the “loading bar’s” left edge. ,,, Make a new layer on top of all the existing ones and call it content. ,, The best thing to simulate content is an image.
Select File > Import > Import to Stage.
Select the picture you want to import and click Open.
The picture will appear on your main scene. ,,, Enter the following ActionScript code inside it: stop(); loadingBar._xscale = 1; var loadingCall:
Number = setInterval(preloadSite, 50); function preloadSite():
Void { var siteLoaded:
Number = _root.getBytesLoaded(); var siteTotal:
Number = _root.getBytesTotal(); var percentage:
Number = Math.round(siteLoaded/siteTotal*100); loadingBar._xscale = percentage; percentClip.percentDisplay.text = percentage + "%"; percentClip._x = loadingBar._x + loadingBar._width; bytesDisplay.text = "loaded " + siteLoaded + " of " + siteTotal + " bytes"; if (siteLoaded >= siteTotal) { clearInterval(loadingCall); gotoAndStop(5); } } , The site will load instantly, of course, because it loads straight from your hard disk and not from some web server. , This will set the simulated speed of download to a standard (slow) 56K modem. , You will now see the preloader at work!
About the Author
Beverly Collins
Professional writer focused on creating easy-to-follow home improvement tutorials.
Rate This Guide
How helpful was this guide? Click to rate: