Understanding the ActionScript Language > About custom objects |
![]() ![]() ![]() |
About custom objects
You can create a custom object with properties and methods to organize information in your scripts for easier storage and access. After you create an object or class, you can create or instantiate copies of that object in a movie.
An object is a complex data type containing zero or more properties and methods. Each property, like a variable, has a name and a value. Properties are attached to the object and contain values that can be changed and retrieved. These values can be of any data type: string, number, Boolean, object, movie clip, or undefined. The following properties are of various data types:
customer.name = "Jane Doe"; customer.age = 30; customer.member = true; customer.account.currentRecord = 000609; customer.mcInstanceName._visible = true;
The property of an object can also be an object. In line 4 of the previous example, account
is a property of the object customer
and currentRecord
is a property of the object account
. The data type of the currentRecord
property is number.
![]() ![]() ![]() |