!--a11y-->
Behavior Definition 
A mobile client application’s behavior is determined by the Microsoft Visual Basic scripts you write and associate directly in Mobile Application Studio (MAS) with individual interaction components. The scripts instruct an interaction component how to respond to specific user actions, system events, or changes in property values.
You can write:
· Methods. A named piece of code that performs a useful but general function (such as closing a window) which you would like the system to perform whenever required without having to rewrite the code.
· Event handlers. A method associated with a specific event and which is performed whenever that event occurs. Event handlers can be written for the following event types:
¡ Standard events
Each interaction component has a set of default events. A standard event for a button control is the onClicked event. A standard event for a tile is the afterClear event.
¡ Custom events
A custom event is one you define especially for an interaction component, but which can be handled only by the parent of the interaction component. Custom events that you define for a tile, for example, are available when you write event handlers in the parent tile set for that tile.
¡ Changes in properties
An event can be defined as a change in a certain property value or as a change of that property value to a specific value. For example, you can specify an event as the moment the value of the Balance field drops below zero. When this condition (event) occurs, the event handler displays the text in the Balance field in red.
¡ Custom properties
You can write a custom property to extend an interaction component’s set of properties. Once you have created a custom property, you can specify it in event handlers and methods.
Write scripts such as a method, event handler, custom events, and custom properties to define the behavior of an UI interaction component. You write scripts from the Scripts View of the Document Outline window for the interaction component currently open in the designer window.
To define behavior for a: |
You write scripts for |
Tile |
Its controls Its business anchors The tile |
Tile set |
Its assigned tiles Its business anchor The tile set |
Business component |
Its assigned tile sets Its business anchors The business component |
Application |
Its assigned business components The application |
See also: