HTMLTextBlock

Kind of class: public class
Package:
Inherits from:
  • Sprite
Version: 27 Apr 2010 Improved inline image alignment
5 Apr 2010
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.text.HTMLTextBlock
File last modified: Thursday, 24 February 2011, 22:09:57
The HTMLTextBlock class displays html text and manages the use of StyleSheets and inline images
Example

  • Create a text block containing the string "txt" that is 500 pixels wide and is styled using the StyleSheet "ss": htmlTextBlock = new HTMLTextBlock(txt, 500, ss);
    Change the width of the HTMLTextBlock to 300: htmlTextBlock.setWidth(300);

Summary

Constructor
Constants
Instance properties
Instance methods

Constructor

HTMLTextBlock

function HTMLTextBlock(txt:String, w:int, ss:StyleSheet = null)
Parameters
 

Constants

IMG_HSPACE

static const IMG_HSPACE:int = 8

IMG_VSPACE

static const IMG_VSPACE:int = 2

Instance properties

blockWidth

blockWidth:int(read,write)

Width of the textfield. Default 0 (autosized).

textfield

textfield:TextField = new TextField()(read,write)

Contains the text.

Instance methods

onLoadComplete

function onLoadComplete() : void

Width of the textfield. Default 0 (autosized).

setWidth

function setWidth(w:int) : void

Sets width of TextBlock