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: |
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: |
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: