Add a Property Change Script
- To add a property change script to a property, right click on the property Property Editor and select Add Change Script...
- The Edit Property Change Script screen is displayed.
Type in the script that you want to run and click OK.
Property Change Arguments
|self||A reference to the component that has the property in question. If the property change script is on a session property, the session object will be passed.|
|previousValue||The previous value, as a QualifiedValue object. QualifiedValue objects have a value, quality, and timestamp. See also Scripting Object Reference.|
The new value, as a QualifiedValue object. QualifiedValue objects have a value, quality, and timestamp. See also Scripting Object Reference.
The origin of the property value, as a unicode string. The origin parameter will take on one of six types depending on how the property value is being updated:
A flag indicating that some events have been skipped due to event overflow.
Change Script Example
- Place a Text Field component and Label component on a Perspective view.
- Select the Text Field component then right click on the text property.
- Click on Add Change Script.
The Edit Property Change Script screen is displayed. Enter the following script, which will write the current value of the Text Field component to the Label component.
- Click OK to commit the script. You'll see that the Property Editor now shows a Change Script icon next to the text property.
- Save your project.
- In a Perspective Session, enter some text into the Text Field component and hit Return. You'll see that the contents are repeated to the Label component.