Using Objects in ActionScript > About objects and classes |
![]() ![]() ![]() |
About objects and classes
ActionScript is an object-oriented programming language. Object-oriented programming uses objects, or data structures, to group together properties and methods that control the object's behavior or appearance. Objects let you organize and reuse code. After you define an object, you can refer to the object by name without having to redefine it each time you use it.
A class is a generic category of objects. A class defines a series of objects that have common properties and can be controlled in the same ways. Properties are attributes that define an object, such as its size, position, color, transparency, and so on. Properties are defined for a class, and values for the properties are set for individual objects in the class. Methods are functions that can set or retrieve properties of an object. For example, you can define a method to calculate the size of an object. Like properties, methods are defined for an object class, and then invoked for individual objects in the class.
ActionScript includes a number of built-in classes, including the MovieClip class and others. You can also create classes to define categories of objects for your movies.
![]() ![]() ![]() |