Kind of class: public class
Inherits from:
  • Sprite
Version: 02 May 2010 Added mediaobject element 27 Apr 2010
Author: John Polacek,
Classpath: com.johnpolacek.components.ContentContainer
File last modified: Thursday, 24 February 2011, 22:09:57
The ContentContainer class is designed for the loading and display of html-formatted content that is loaded from an xml formatted document. XML conforms to the DocBook DTD.

  • // create ContentContainer that is 500 pixels wide
    var container:ContentContainer = new ContentContainer(500);
    // assign a filepath for all content being loaded
    container.contentPath = "content/";
    // apply a style sheet to all HTMLTextBlocks
    container.textStyleSheet = styleSheet;
    // set 10 pixels vertical spacing between content elements
    container.spacing = 10;
    // set color for any horizontal rule lines
    container.lineColor = 0x999999;
    // loads xml file, parses it and then loads content
    // add listener for when all content is loaded into the container
    container.addEventListener(Event.COMPLETE, onContainerLoadComplete);
    For a good example of xml formatting for this class, refer to the ReadingRoom Demo and its context.xml file.
See also