791
E
APPENDIX E
Object-Oriented Programming
with ActionScript 1.0
The information in this appendix comes from the Macromedia Flash MX documentation and
provides information on using the ActionScript 1.0 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.0.
■ If you already use ActionScript 1.0 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.0 is deprecated. Instead, for information on using
ActionScript 2.0, see Chapter 7, “Classes,” on page 225.
This chapter contains the following sections:
About ActionScript 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .792
Creating a custom object in ActionScript 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .794
Assigning methods to a custom object in ActionScript 1.0. . . . . . . . . . . . . . . . . . . .795
Defining event handler methods in ActionScript 1.0 . . . . . . . . . . . . . . . . . . . . . . . . .796
Creating inheritance in ActionScript 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .798
Adding getter/setter properties to objects in ActionScript 1.0. . . . . . . . . . . . . . . . 800
Using Function object properties in ActionScript 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . 801
NOTE
Some examples in this appendix use the Object.registerClass() method. This method is
supported only in Flash Player 6 and later versions; don’t use this method if you are
targeting Flash Player 5.