One of the primary benefits of object-oriented programming is that you can create subclasses of a class; the subclass then inherits all the properties and methods of the superclass. The subclass typically defines additional methods and properties, or extend the superclass. Subclasses can also override, or provide their own definitions for, methods inherited from a superclass.
For example, you might create a Mammal class that defines certain properties and behaviors common to all mammals. You could then create a Cat class that extends the Mammal class. In this way, inheritance can promote code reuse: instead of recreating all the code common to both classes, you can simply extend an existing class. Another class, in turn, could subclass the Cast class, and so on. In a complex application, determining how best to structure the hierarchy of your classes is a large part of the design process.
In ActionScript, you use the extends
keyword to establish inheritance between a class and it's superclass. For more information, see Implicit getter/setter methods.