Events
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" |
Purpose: |
Remove an event previously set with OnKeyDown |
Category: |
Events |
Syntax: |
RemoveOnKeyDown |
Example: |
RemoveOnKeyDown |
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. |
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: subroutine name Subroutine to execute whenever the event happens on the given object. |
Example: |
OnMouseEvent "Container1" "click" "mysubroutine" |
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: |
Example: |
RemoveOnMouseEvent "Container1" "click" |
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" |
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" |
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" |
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" |
Purpose: |
Delete the on window resize event previously set with OnWindowResize. |
Category: |
Events |
Syntax: |
RemoveOnWindowResize |
Example: |
RemoveOnWindowResize |
Purpose: |
Get the name of the object that fired the current 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: