How To Assign A Behavior

This lesson will show you how to assign the behavior property of a control in LiveCode.

What is a Behavior?

What is a Behavior?

A behavior is merely the script of a button (1) that can be assigned to other controls (2). Any control that has it's behavior property assigned to the button will inherit the script of the button as its own.

Assigning a Behavior

Assigning a Behavior

You assign a button as the behavior of another control by setting the control's behavior property to the long id of the button (1). Now any changes you make to the script of the button will alter how the control behaves since you are essentially changing the script assigned to the control.

For example, if the button (2) has an openField handler defined in it's script then when openField is sent to the field (3) that code would be executed.

0 Comments

Add your comment

E-Mail me when someone replies to this comment