ContentPanel

Kind of class: public class
Package:
Inherits from:
  • Sprite
Version: 27 Apr 2010
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.components.ContentPanel
File last modified: Thursday, 24 February 2011, 22:09:57
The ContentPanel class displays content in a panel that can be formatted with a background and margins. It is designed to work with the ContentContainer class to provide an efficient method of loading and displaying html-formatted content from an xml file.
See also
  • com.johnpolacek.media.ContentContainer

Summary

Constructor
Instance properties
  • container : Sprite
    • Contains all panel elements except the background.
  • background : Sprite
    • Background sprite
  • format : ContentPanelFormat
    • Object contains all formatting for the ControlPanel.
  • styleSheet : StyleSheet
    • StyleSheet that is applied to all html-formatted text
  • contentPath : String
    • Path to all the content files (jpg, flv, etc.)
Instance methods

Constructor

ContentPanel

function ContentPanel()
Parameters
 

Instance properties

background

background:Sprite = new Sprite()(read,write)

Background sprite

container

container:Sprite = new Sprite()(read,write)

Contains all panel elements except the background.

contentPath

contentPath:String = ""(read,write)

Path to all the content files (jpg, flv, etc.) Default: ""

format

format:ContentPanelFormat = new ContentPanelFormat()(read,write)

Object contains all formatting for the ControlPanel. If no formatting assigned, defaults are used.

styleSheet

styleSheet:StyleSheet = new StyleSheet()(read,write)

StyleSheet that is applied to all html-formatted text Default: Empty StyleSheet (No styling)

Instance methods

addElement

function addElement(element:Sprite) : void

Adds a sprite to the bottom of the panel.

Parameters
element:Sprite to be added to the panel.

addElementFromXML

function addElementFromXML(xml:XML) : void

Creates a new ContentContainer and loads content into it from xml.

Parameters
url:URL of XML file with CDATA containing the html for the content.

loadElementFromXML

function loadElementFromXML(url:String) : void

Creates a new ContentContainer and loads content into it from xml.

Parameters
url:URL of XML file with CDATA containing the html for the content.

onContainerLoadComplete

function onContainerLoadComplete(event:Event) : void

Container load complete handler

onXMLLoadError

function onXMLLoadError(event:IOErrorEvent) : void

XML loader io error handler.

setBackground

function setBackground() : void

setFormat

function setFormat(f:ContentPanelFormat)

Set formatting