Packagecom.greensock.loading.display
Classpublic class ContentDisplay
InheritanceContentDisplay Inheritance flash.display.Sprite

A container for visual content that is loaded by any of the following: ImageLoaders, SWFLoaders, or VideoLoaders. It is essentially a Sprite that has a loader property for easily referencing the original loader, as well as a rawContent property. That way, you can add a ContentDisplay to the display list or populate an array with as many as you want and then if you ever need to unload() the content or reload it or figure out its url, etc., you can reference your ContentDisplay's loader property like myContent.loader.url or (myContent.loader as SWFLoader).getClass("com.greensock.TweenLite");

Flex users can utilize the FlexContentDisplay class instead which extends UIComponent (a Flex requirement). All you need to do is set the LoaderMax.contentDisplayClass property to FlexContentDisplay once like:


Example
Example AS3 code:
 import com.greensock.loading.*;
 import com.greensock.loading.display.*;
 
LoaderMax.contentDisplayClass = FlexContentDisplay;
 
After that, all ImageLoaders, SWFLoaders, and VideoLoaders will return FlexContentDisplay objects as their content instead of regular ContentDisplay objects.

Copyright 2010, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.



Public Properties
 PropertyDefined by
  loader : LoaderItem
The loader whose rawContent populates this ContentDisplay.
ContentDisplay
  rawContent : *
The raw content which can be a Bitmap, a MovieClip, a Loader, or a Video depending on the type of loader associated with the ContentDisplay.
ContentDisplay
Public Methods
 MethodDefined by
  
Constructor
ContentDisplay
  
dispose(unloadLoader:Boolean = true, disposeLoader:Boolean = true):void
Removes the ContentDisplay from the display list (if necessary), dumps the rawContent, and calls unload() and dispose() on the loader (unless you define otherwise with the optional parameters).
ContentDisplay
Property detail
loaderproperty
loader:LoaderItem  [read-write]

The loader whose rawContent populates this ContentDisplay. If you get the loader's content, it will return this ContentDisplay object.

Implementation
    public function get loader():LoaderItem
    public function set loader(value:LoaderItem):void
rawContentproperty 
rawContent:*  [read-write]

The raw content which can be a Bitmap, a MovieClip, a Loader, or a Video depending on the type of loader associated with the ContentDisplay.

Implementation
    public function get rawContent():*
    public function set rawContent(value:*):void
Constructor detail
ContentDisplay()constructor
public function ContentDisplay(loader:LoaderItem)

Constructor

Parameters
loader:LoaderItem — The Loader object that will populate the ContentDisplay's rawContent.
Method detail
dispose()method
public function dispose(unloadLoader:Boolean = true, disposeLoader:Boolean = true):void

Removes the ContentDisplay from the display list (if necessary), dumps the rawContent, and calls unload() and dispose() on the loader (unless you define otherwise with the optional parameters). This essentially destroys the ContentDisplay and makes it eligible for garbage collection internally, although if you added any listeners manually, you should remove them as well.

Parameters
unloadLoader:Boolean (default = true) — If true, unload() will be called on the loader. It is true by default.
 
disposeLoader:Boolean (default = true) — If true, dispose() will be called on the loader. It is true by default.