Customizing loader skin for components (AS3)

Author: Digicrafts Last Update: 08/04/2008

Example can find inside the download product (example > loading progress).

1. Setup a component which support custom loader. 
 

 2.Create a custom loader skin.

 Add a dynamic text box.


 

Select and convert it to a movie symbol by pressing F8 or menu "Modify>Convert to Symbol"

 

Open library panel. Right click the movie symbol created before and click linkage.





 
 Fill in the class name: Here i fill with "customLoader"

 
3.Add necessary Action Script.


Edit the sybmol created before. Select 1st frame and open the Action Script Panel (F9).

 
Fill int the following script.
function onProgress(value:Number) {
// value from 0 - 1
this.loading_txt.text = "Loading " + value*100 + " %";
}

The "value" is from 0 to 1 represent the progress from 0 to 100%.
4.Fill in the skin name in component inspector. Here i fill in "customLoader".