Using Director > Parent Scripts > Writing a parent script > Declaring property variables

 

Declaring property variables

Each child object created from the same parent script initially contains the same values for its property variables. A property variable's value belongs only to the child object it's associated with. Each property variable and its value persists as long as the child object exists. The initial value for the property variable is typically set in the on new handler; if it's not set, the initial value is VOID.

To declare a property variable:

Use the property keyword at the beginning of the parent script. See property.

To set and test property variables from outside the child object:

Set and test property variables in the same way you would any other property in Lingo, by using the syntax the propertyName of whichObject or whichObject.propertyName.

This statement sets the speed property of the object car1:

car1.speed = 55