• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Interfaces > About interfaces

About interfaces

In object-oriented programming, interfaces are like classes whose methods are not implemented (defined)—that is, they otherwise don’t “do” anything. Therefore, an interface consists of “empty” methods. Another class can then implement the methods declared by the interface. In ActionScript, the distinction between interface and object is only for compiletime error checking and language rule enforcement.

An interface is not a class; however, this is not altogether true in ActionScript at runtime because an interface is abstract. ActionScript interfaces do exist at runtime to allow type casting (changing an existing data type to a different type). The ActionScript 2.0 object model does not support multiple inheritance. Therefore, a class can inherit from a single parent class. This parent class can be either a core or Flash Player class or a user-defined (custom) class. You can use interfaces to implement a limited form of multiple inheritance, by which a class inherits from more than one class.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint