Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Among the most easily explained concepts of an object-oriented programming model is inheritance. This means that you can create a new class, typically called a subclass, which can inherit attributes from the original class, also called the superclass. This is similar to the way you inherit characteristics from your parents. You share many things in common with a parent but also have several unique attributes. The same can be said of classes. Through inheritance, a class can acquire from its parent useful methods and properties, as well as add entirely new methods and properties.
The source files for this section are found in the inheritance_mc folder in the Chapter 6 archive—available from the Downloads page at the companion website, http://www.LearningActionScript3.com. Ultimately, you’ll test the FLA file, inheritance_mc_01.fla, but you’ll be working primarily with the Box.as and Square.as class files.