This example shows you how to write a script that changes a Variable object's current value when clicking text at run time.
To change a Variable object's caption:
- Create a Variable object.
- Change the object's type to Long.
- Create a Text object.
- Using the Animations dialog box, animate the Text object's Caption using the Variable object's CurrentValue property as its data source.
- Right-click the Text object and select Edit Script from the pop-up menu.
- Enter the following code in the Text object's Click event:
Variable1.CurrentValue = Variable1.CurrentValue + 10
- Switch to the run-time environment and click the Text object.
The caption of the Text object increments by 10 (as will the Variable's current value).
See Also
Creating a Direct Connection to an Object
Changing a Text Object's Caption
Changing the Data Source of a Data Link