OnKeyDown

Purpose:

Detect a KeyDown event and executes a given subroutine sending the keycode to it. To determine which key was pressed, create a Subroutine with a single integer parameter. This parameter will contain the number of the pressed key (37 right arrow, 38 up arrow...).

Category:

Events

Syntax:

OnKeyDown "subroutine name"

subroutine name

The name of the subroutine to execute each time a key is pressed.

Example:

OnKeyDown "MySubroutine"


RemoveOnKeyDown

Purpose:

Remove an event previously set with OnKeyDown

Category:

Events

Syntax:

RemoveOnKeyDown

Example:

RemoveOnKeyDown



OnMouseEvent

Purpose:

Detect a Mouse event and executes a given subroutine. You can determine which object fired the subroutine by using the GetThisObjectName command inside the subroutine.
This way you can use a single subroutine to manage many different objects.
It's possible to attach events to design time objects, run time duplicated objects and drawing objects.

Category:

Events

Syntax:

OnMouseEvent "object name" "event name" "subroutine name"

object name

The object to attach the event to.

event name

One of the following mouse events:
click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,
mouseleave,select,wheel,contextmenu or scroll

subroutine name

Subroutine to execute whenever the event happens on the given object.

Example:

OnMouseEvent "Container1" "click" "mysubroutine"


RemoveOnMouseEvent

Purpose:

Remove an object mouse event previously set with OnMouseEvent

Category:

Events

Syntax:

RemoveOnMouseEvent "object name" "event name"

object name

The object to attach the event to.

event name

One of the following mouse events:
click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,
mouseleave,select,wheel,contextmenu or scroll

Example:

RemoveOnMouseEvent "Container1" "click"


OnTouchEvent

Purpose:

Set the subroutine to execute when a touch event occurs.

Category:

Events

Syntax:

OnTouchEvent "object name" "touch event name" "subroutine name"

object name

The object to attach the event to.

touch event name

One of the following touch event names: touchstart, touchmove, touchend, touchenter, touchleave, touchcancel

subroutine name

The name of the subroutine to execute each time a the touch event occurs.

Example:

OnTouchEvent "NewPage" "touchstart" "mysubroutine"


RemoveOnTouchEvent

Purpose:

Remove a previously defined touch event.

Category:

Events

Syntax:

RemoveOnTouchEvent "object name" "touch event name"

object name

The object to remove the event from.

touch event name

One of the following touch event names: touchstart, touchmove, touchend, touchenter, touchleave, touchcancel

Example:

RemoveOnTouchEvent "NewPage" "touchstart"


OnDocumentReady

Purpose:

The document ready event occurs when the DOM (document object model) has been loaded and it's save to use any script over any object.

This command executes a given subroutine once the document ready event occurs.

Category:

Events

Syntax:

OnDocumentReady "subroutine name"

subroutine name

The name of the subroutine to execute when the document is ready.

Example:

OnDocumentReady "MySubroutine"


OnWindowResize

Purpose:

Call a subroutine whenever the browser window is resized.

Category:

Events

Syntax:

OnWindowResize "subroutine name"

subroutine name

The name of the subroutine to execute when the browser window is resized.

Example:

OnWindowResize "MySubroutine"


RemoveOnWindowResize

Purpose:

Delete the on window resize event previously set with OnWindowResize.

Category:

Events

Syntax:

RemoveOnWindowResize

Example:

RemoveOnWindowResize


GetThisObjectName

Purpose:

Get the name of the object that fired the current event.
Use this command only within a subroutine called from an event.

Category:

Events

Syntax:

GetThisObjectName "[result var]"

result var

Variable to store the result.

Example:

GetThisObjectName "[theObjectName]"


These event related commands can be found in their corresponding sections:


OnVideoEvent 

OnAudioEvent

OnLoadSuccess

OnLoadError

OnLoadEnd

RemoveOnloadSuccess

RemoveOnloadError

RemoveOnloadEnd