About Object-Oriented Programming And Flash - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

For more information on working with custom and built-in classes, see the following topics:
About object-oriented programming and Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226
Writing custom class files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235
About working with custom classes in an application . . . . . . . . . . . . . . . . . . . . . . . .238
Example: Writing custom classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .263
Example: Using custom class files in Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Assigning a class to symbols in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279
Compiling and exporting classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Understanding classes and scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .283
About top-level and built-in classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .286
About working with built-in classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .296
About object-oriented programming and
Flash
ActionScript 2.0 is an object-oriented language. Like ActionScript, OOP languages are based
on the concept of classes and instances. A class defines all of the properties that distinguish a
series of objects. For example, a User class represents a bunch of users who are using your
application. Then, you have an instantiation of the class, which, for the User class, is one of
the individual users-one of its members. The instantiation produces an instance of the User
class, and that instance has all of the properties of the User class.
Classes are also considered like data types or templates that you can create to define a new type
of object. For example, if you need a data type of Lettuce in your application, you might write
the Lettuce class. This defines the Lettuce object, and then you can assign your Lettuce
methods (
) and properties (
or
). To define a class, you use the
wash()
leafy
bugs
class
keyword in an external script file. You can create an external script file in the Flash authoring
tool by selecting File > New and then selecting ActionScript File.
226
Classes

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents