Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class RichTextArea

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.core.LabelWrapper
              |
              +--com.bjc.controls.TextArea
                    |
                    +--com.bjc.controls.RichTextArea


class RichTextArea
extends TextArea

Rich Text area component for displaying text or allowing input of large amounts of text. This component handles all HTML formatting that Flash can handle.

Events:

change - Fired whenever the user has changed the text in the text area by typing a new character or deleting any content. Will not fire when text is changed programatically via the text property.
focus - Fired whenever the internal text field receives focus.
killFocus - Fired whenever the internal text field loses focus.
scroll - Fired once each frame while text is being scrolled.
selection - Fired whenever the text selection has changed.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
selectionHandler: Function
Can be used to assign a direct event handler to the component instance.

Fields inherited from class com.bjc.controls.TextArea

addEventListener, changeHandler, focusHandler, killFocusHandler, removeEventListener, scrollHandler, tabFocusHandler

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
mode: Number (write)
Sets the mode of the component. If set to 0, the html format is on. If set to 1, the html tags are visible and are editable.

public
mode: Number (read)
Gets the mode of the component.

public
newTextFormat: TextFormat (write-only)
Sets the text format of the component.

public
updateInterval: Number (write)
Sets the update speed of the rich text area.

public
updateInterval: Number (read)
Gets the update speed of the rich text area.

Properties inherited from class com.bjc.controls.TextArea

condenseWhite, editable, hscroll, maxChars, maxhscroll, maxscroll, password, restrict, scroll, scrollBarWidth, selectable, text, textField, textHeight, wordWrap

Properties inherited from class com.bjc.core.LabelWrapper

align, disabledColor, disableStyles, embedFont, fontColor, fontFace, fontSize, html

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
RichTextArea ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): RichTextArea
Static method used to create an instance of a RichTextArea on stage at run time.

public
setFormatProperty ( name: String, value: Object ): Void
This method may be used to set text format properties to the text selection.

Methods inherited from class com.bjc.controls.TextArea

create

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

selectionHandler

public var selectionHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myRTA.selectionHandler = function(){
trace("Selection was changed.");
}


Property Documentation

mode

public mode: Number (write)
Sets the mode of the component. If set to 0, the html format is on. If set to 1, the html tags are visible and are editable.

Example:
myRTA.mode = 1;

mode

public mode: Number (read)
Gets the mode of the component.

Example:
myVar = myRTA.mode;

newTextFormat

public newTextFormat: TextFormat (write-only)
Sets the text format of the component.

Example:
myRTA.newTextFormat = myTextFormat;

updateInterval

public updateInterval: Number (write)
Sets the update speed of the rich text area.

Example:
myRTA.updateInterval = 50;

updateInterval

public updateInterval: Number (read)
Gets the update speed of the rich text area.

Example:
myVar = myRTA.updateInterval;


Constructor Documentation

RichTextArea

public function RichTextArea(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): RichTextArea
Static method used to create an instance of a RichTextArea on stage at run time.

Overrides:

Parameters:
target
the movie clip to which the rich text area will be attached.
id
the instance name given to the new rich text area attached.
depth
the depth at which to attach the new rich text area.
initObj
(optional) an object containing any properties you want to assign to the component when it is created.
Returns:
a reference to the new rich text area attached.

Example:
import com.bjc.controls.RichTextArea;
var newRTA:RichTextArea = RichTextArea.create(_root, "myRTA", 0);

setFormatProperty

public function setFormatProperty(name: String,
 value: Object): Void
This method may be used to set text format properties to the text selection.

Parameters:
name
the name of the property.
value
the value of the given property.
Returns:
nothing.

Example:
Bold:
myRTA.setFormatProperty( "bold", true ); // value:Boolean
Italic:
myRTA.setFormatProperty( "italic", true ); // value:Boolean
Underline:
myRTA.setFormatProperty( "underline", true ); // value:Boolean
Bullet:
myRTA.setFormatProperty( "bullet", true ); // value:Boolean
Color:
myRTA.setFormatProperty( "color", 0xff0000 ); // value:Number
URL:
myRTA.setFormatProperty( "url", "http://www.flashloaded.com" ); // value:String
URL target:
myRTA.setFormatProperty( "target", "_self" ); // value:String
Font:
myRTA.setFormatProperty( "font", "Arial" ); // value:String
Align:
myRTA.setFormatProperty( "align", "left" ); // value:String
Font size:
myRTA.setFormatProperty( "size", 12 ); // value:Number
Left margin:
myRTA.setFormatProperty( "leftMargin", 20 ); // value:Number
Right margin:
myRTA.setFormatProperty( "rightMargin", 20 ); // value:Number
Indent:
myRTA.setFormatProperty( "indent", 20 ); // value:Number
Block indent:
myRTA.setFormatProperty( "blockIndent", 20 ); // value:Number
Leading:
myRTA.setFormatProperty( "leading", 20 ); // value:Number
Tab stops:
myRTA.setFormatProperty( "tabStops", [0, 40, 80, 120] ); // value:Array


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com