
Calling object methods
You can call an object's method by using the dot (.
) operator followed by the method. For example, the following example calls the setVolume
method of the Sound object:
mySound = new Sound(this);
mySound.setVolume(50);
To call the method of a built-in object in the Actions panel in normal mode, use the evaluate
action.
To call a method in normal mode:
- Select Window > Actions to open the Actions panel if it's not already open.
- Click the Actions category in the Actions toolbox (at the left of the panel), and then click the Miscellaneous Actions category.
- Double-click the
evaluate
action.
- In the Expression box, enter the name of the object, for example,
mySound
.
- Click the Objects category in the Actions toolbox, and click the category of the object you want to create. When you find the method you want to use, double-click it.
