Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the earlier section "Section 28.1.4," we learned that the Loader class's instance variable content refers to an object representing a loaded asset. We also learned that—depending on which type of asset was loaded—content might refer to an instance of either the Bitmap class or a .swf file's main class. Instances of those disparate classes can legally be assigned to content because its datatype is DisplayObject, and both the Bitmap class and all .swf file main classes inherit from DisplayObject. As a result, any object assigned to content can be operated on using the variables and methods of DisplayObject but cannot be operated on using the more specific variables and methods of either the Bitmap class or a .swf 's main class.
For example, the following code legally accesses the DisplayObject class's instance variable width on an object referenced via content: