Upon completion of the tutorial press twice consecutively Ctrl. + Intro, and is how we view as the charger works.
Now the second part deals with the tutorial, to complete the tutorial just need to put the design of the preloader into the scene and then import an image to the scene. These steps are explained below.
Step 11
Clicking the right mouse button on the bar layer.
In the popup menu select Mask.
Step 12
Once the mask is inserted that is how it should be noted the Timeline.
Step 13
The following steps will take place the animation on the Scene.
When you are located in the Scene, changing the name to the loader layer to open the Library panel Ctrl. + L.
Then drag the symbol from the Library preloader.
Step 14
Now select the symbol is inserted, and open the Properties pane Ctrl. + F3.
Type the following preloader_mc instance name.
Step 15
Insert a second layer and writing action script as a name.
Select the Frame inserted into this layer.
Open the panel Actions - Frame then write the following actionscript code.
stop();
addEventListener(Event.ENTER_FRAME,loaderF);
function loaderF(e:Event):void {
var toLoad:Number=loaderInfo.bytesTotal;
var loaded:Number=loaderInfo.bytesLoaded;
var total:Number=loaded/toLoad;
if (loaded==toLoad) {
removeEventListener(Event.ENTER_FRAME,loaderF);
gotoAndStop(2);
} else {
preloader_mc.preloader_bar.scaleX=total;
preloader_mc.total_bytes.text=toLoad+" total bytes";
}
}
Step 16
Insert the last layer and rename it to content.
Then add a second Frame F6.
Step 17
To make sure the preloader works great need to Import an image to the scene.
Follow the following sequence to import image File >> Import >> Import to Stage ...
The dimensions of the picture must be of the same size as the film 500.0 width px 400 0 px high.
Step 18
When the image is inserted into the second frame of the content layer, open the Properties pane Ctrl. F3 and place the image in coordinates X: 0.0 Y: .0.
With this step is completed the tutorial Programming a Preloader in Flash CS4 with ActionScript 3.0.
Well Done!
Upon completion of the tutorial press twice consecutively Ctrl. + Intro, and is how we view as the charger works.