| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
MultiPreloader |
|
|
See also
| Property | Defined By |
|---|---|
| All inherited properties of the Sprite class. | N/A |
| Method | Defined By |
|---|---|
|
MultiPreloader(myArray:Array, _path:String="")
Constructor |
MultiPreloader |
| Event | Defined By |
|---|---|
|
loadComplete This event is dispatched when preloading is completed. |
MultiPreloader |
| All inherited events for the Sprite class. | N/A |
| Constructor Detail |
|---|
|
MultiPreloader () Constructor
public function MultiPreloader(myArray:Array, _path:String="") |
| Intializes a new MultiPreloader instance. |
| Method Detail |
|---|
|
MultiPreloader () Constructor
public function MultiPreloader(myArray:Array, _path:String="") |
| Intializes a new MultiPreloader instance. |
Parameters
|
| Event Detail |
|---|
|
loadComplete event
Event Object Type:
biz.flashscript.utils.MultiPreloader
Dispatched when preloading is completed. |
| Examples |
|---|
Create a new fla file and name it Multipreloader.fla. Place the fla in the same folder as the biz folder. You need to have a folder "images" with several images inside. Then create an Actionscript file, name it Multipreloader.as and place this script. Change the names of the images accordingly.
package
{
import flash.display.*;
import flash.events.Event;
import biz.flashscript.utils.MultiPreloader;
public class Multipreloader extends Sprite
{
public function Multipreloader ():void
{
var myArray:Array = new Array("1367942.jpg","1367976.jpg","1368580.jpg","1368732.jpg","1369844.jpg","1370120.jpg","1370122.jpg","1370126.jpg","1370132.jpg");
var mp:MultiPreloader = new MultiPreloader(myArray,"images/");
addChild (mp);
mp.addEventListener ("loadComplete",onComplete);
}
private function onComplete (e:Event):void
{
var mp:DisplayObjectContainer = e.currentTarget as DisplayObjectContainer;
removeChild (mp);
trace("exit");
}
}
}
|