For more information on using interfaces, see the following sections:
"About the interface keyword" on page 315
"About naming interfaces" on page 315
"Defining and implementing interfaces" on page 316
About the interface keyword
The
keyword defines an interface. An interface is similar to a class, with the
interface
following important differences:
Interfaces contain only declarations of methods, not their implementation. That is, every
class that implements an interface must provide an implementation for each method
declared in the interface.
Only public members are allowed in an interface definition; static and class members are
not permitted.
The
and
get
set
To use the
interface
later in the Flash tab of your FLA file's Publish Settings dialog box.
The
keyword is supported only when used in external script files, not in scripts
interface
that you write in the Actions panel.
About naming interfaces
Interface names have an uppercase first letter, the same as class names. Interface names are
usually adjectives, such as
uses an initial uppercase letter and concatenated words with mixed case:
interface IEmployeeRecords {}
Some developers start interface names with an uppercase "I" to distinguish them from
classes. This is a good practice to adopt because it lets you quickly distinguish between
interfaces and regular classes.
For more information on naming conventions, see
Conventions for ActionScript 2.0," on page
statements are not allowed in interface definitions.
keyword, you must specify ActionScript 2.0 and Flash Player 6 or
. The following interface name,
Printable
Chapter 19, "Best Practices and Coding
731.
,
IEmployeeRecords
About interfaces
315
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?