onLoad()
Top  Previous  Next


Syntax
onLoad() {
   statement(s);
}

Arguments
None.

Returns
Nothing.

Description
This Event Handler function is called when the Scene / Sprite / Object is loaded.
This function is useful for defining boundary (initial) conditions and initialising variables.

Note: Commands that affect the play order of other Sprites / Objects may yield unpredictable results, as the exact order of loading is not defined

Sample
onLoad() {
   mydebug = 0;   // define and initialise variable
   this._vx = 10;   // set initial velocity
}