| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
LoaderClassStatic |
|
|
See also
| Property | Defined By |
|---|---|
| All inherited properties of the Sprite class. | N/A |
| Method | Defined By |
|---|---|
|
LoaderClassStatic()
Creates a new instance of the LoaderClassStatic class. |
LoaderClassStatic |
|
initLoader(myURL:String, loadFinished:Function, myTarget:Object, lBar:String=null)
Proceeds with loading. |
LoaderClassStatic |
| Event | Defined By |
|---|---|
| All inherited events for the Sprite class. | N/A |
| Constructor Detail |
|---|
|
LoaderClassStatic () Constructor
public function LoaderClassStatic() |
| Intializes a new LoaderClassStatic instance with the specified parameters. |
| Method Detail |
|---|
|
initLoader ():void method
public function initLoader(myURL:String, loadFinished:Function, myTarget:Object, lBar:String=null) |
Parameters
|
| Examples |
|---|
Create a new fla file and name it Loaderclassstatic.fla. Place the fla in the same folder as the biz folder. Have two movies or images etc ready in the same folder. Then create an Actionscript file, name it Loaderclassstatic.as and place this script. Change the names for the movies etc in the script accordingly.
package
{
import flash.display.Sprite;
import flash.utils.Timer;
import flash.events.*;
import biz.flashscript.utils.LoaderClassStatic;
public class Loaderclassstatic extends Sprite
{
private var myLoader:LoaderClassStatic;
private var url:String = "testmovie1.swf";
private var count:int = 0;
public function Loaderclassstatic ():void
{
myLoader = new LoaderClassStatic();
myLoader.initLoader (url, completed,this);
var myTimer:Timer = new Timer(1,100);
myTimer.addEventListener (TimerEvent.TIMER, handler);
myTimer.start ();
}
private function handler (e:TimerEvent):void
{
count++;
if (count >= 100)
{
url = "testmovie2.swf";
myLoader.initLoader (url, completed, this);
}
}
private function completed (e:Event):void
{
trace ("loaded");
}
}
}
|