Object-Oriented Programming with ActionScript 1
The information in this appendix comes from the Macromedia Flash MX documentation and
provides information on using the ActionScript 1 object model to write scripts. It is included here
for the following reasons:
•
If you want to write object-oriented scripts that support Flash Player 5, you must
use ActionScript 1.
•
If you already use ActionScript 1 to write object-oriented scripts and aren't ready to switch to
ActionScript 2.0, you can use this appendix to find or review information you need while
writing your scripts.
If you have never used ActionScript to write object-oriented scripts and don't need to target
Flash Player 5, you should not use the information in this appendix because writing object-
oriented scripts using ActionScript 1 is deprecated. Instead, for information on using
ActionScript 2.0, see
Note: Some examples in this appendix use the
supported only in Flash Player 6 and later; don't use this method if you are targeting Flash Player 5.
About ActionScript 1
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 it 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. As with properties, methods are defined for an object class and then invoked for
individual objects in the class.
ActionScript includes several built-in classes, including the MovieClip class, Sound class, and
others. You can also create custom classes to define categories of objects for your applications.
Chapter 10, "Creating Custom Classes with ActionScript 2.0," on page
Object.RegisterClass()
APPENDIX E
method. This method is
247.
323
Need help?
Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?