EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - APPENDIX E: Object-Oriented Programming with Actionscript 1; About Actionscript 1

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
799
APPENDIX E
Object-Oriented Programming with ActionScript 1
The information in this appendix was excerpted 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 arent ready to switch to
ActionScript 2.0, you can use this appendix to find or review information you need while
writing your ActionScript 1 scripts.
If you have never used ActionScript to write object-oriented scripts and dont 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, see Chapter 9, “Creating Classes with
ActionScript 2.0,” on page 155 for information on using ActionScript 2.0.
Note: Some of the examples in this appendix use the Object.RegisterClass() method. This method
is 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 objects
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 several built-in classes, including the MovieClip class and others. You can
also create classes to define categories of objects for your applications.

Table of Contents

Related product manuals