Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact |

Preloader

Package:
Class:
Inheritance:
biz.flashscript.components.preloader
public class Preloader
Sprite
The Preloader component is used for preloading a movie. It is placed in the first frame of the movie. When loading is done an event is dispatched.

See also

   biz.flashscript.utils.Preloader

Public Properties
Property Defined By
barXpos : int
Specifies the x position of the loader animation.
Preloader
barYpos : int
Specifies the y position of the loader animation.
Preloader
Public Methods
Method Defined By
Preloader()
Creates a new instance of the Preloader component.
Preloader
Events
Event Defined By

loadComplete

This event is dispatched when the preloading is completed.

Preloader
All inherited events for the Sprite class. N/A
Property Detail

barXpos property
barXpos:int [read-write]

Specifies the x position of the loader animation.

The default value is 0.

.

Implementation

public function get barXpos():int
public function set barXpos(value:int):void

barYpos property
barYpos:int [read-write]

Specifies the y position of the loader animation.

The default value is 0.

.

Implementation

public function get barYpos():int
public function set barYpos(value:int):void
Constructor Detail
Preloader ()  Constructor
public function Preloader()
Intializes a new Preloader instance.
Method Detail
N/A
Event Detail

loadComplete event

Event Object Type: biz.flashscript.components.preloader.Preloader
Event.type property = biz.flashscript.components.preloader.Preloader.LOAD_COMPLETE

Dispatched when preloading is completed (see example).

Examples
Create a new fla file and name it Preloader.fla. Place the fla in the same folder as the biz folder. Create a second frame and name it "frame2". Then add this script in a frame on the main timeline and test movie. You should see the timeline moving to frame 2.
stop ();
addEventListener(Preloader.LOAD_COMPLETE, completeHandler);
function completeHandler(ev:Event):void
{
	trace("Loading is now complete!");
	gotoAndStop("frame2");
}