Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class TextArea

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

All Known Subclasses: RichTextArea

class TextArea
extends LabelWrapper

Text area component for displaying text or allowing input of large amounts of text.

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.
tabFocus - Fired whenever the internal text field receives focus by pressing the TAB key.
scroll - Fired once each frame while text is being scrolled.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
addEventListener: Function
See the EventDispatcher Class in Flash Help

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

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

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

public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

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

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

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
condenseWhite: Boolean (write)
Specified whether or not extra white space (spaces and returns) will be stripped out of the text. Only valid if html is set to true.

public
condenseWhite: Boolean (read)
Gets the extra white space mode of the component.

public
editable: Boolean (write)
Specified whether or not the user will be able to select and edit the text in the text area.

public
editable: Boolean (read)
Gets the editable mode of the component.

public
hscroll: Number (write)
Sets the current horizontal scroll value for the text field in the component, as described in the Flash help.

public
hscroll: Number (read)
Gets the current horizontal scroll value for the text field in the component, as described in the Flash help.

public
maxChars: Number (write)
Sets the maximum number of allowable characters in the the text area. If set to 0, there will be no limitation.

public
maxChars: Number (read)
Gets the maximum number of allowable characters in the the text area.

public
maxhscroll: Number (read-only)
Gets the current maxhscroll value for the text field in the component, as described in the Flash help.

public
maxscroll: Number (read-only)
Gets the current maxscroll value for the text field in the component, as described in the Flash help.

public
password: Boolean (write)
Sets the password mode of the component. If true, text entered into the text area will not be legible, allowing for secure password entry.

public
password: Boolean (read)
Gets the password mode of the component.

public
restrict: String (write)
Restricts the characters that can be entered in the text area. See the Flash help for TextField.restrict for a full description on how to use this property. In the text area component, setting restrict to "" will allow any characters to be entered.

public
restrict: String (read)
Gets the character restriction of the component.

public
scroll: Number (write)
Sets the current scroll value for the text field in the component, as described in the Flash help.

public
scroll: Number (read)
Gets the current scroll value for the text field in the component, as described in the Flash help.

public
scrollBarWidth: Number (write)
Sets the width of the scrollbar used in the text area (if needed)

public
scrollBarWidth: Number (read)
Gets the width of the scrollbar used in the text area (if needed)

public
selectable: Boolean (write)
Specified whether or not the user will be able to select the text in the text area.

public
selectable: Boolean (read)
Gets the selectable mode of the component.

public
text: String (write)
Sets the text in the text area. This can include html tags which will be rendered if html is set to true.

public
text: String (read)
Gets the text displayed in the text area.

public
textField: TextField (read-only)
Returns a reference to the text field within the text area. You can use this for lower level control of the text, such as applying style sheets, or to access properties of the text field not exposed to the component.

public
textHeight: Number (read-only)
The height of the text in the the text area. This is simply the textHeight taken from the internal text field in the component.

public
wordWrap: Boolean (write)
Sets the wordWrap mode of the text area.

public
wordWrap: Boolean (read)
Gets the wordWrap mode of the text area.

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
TextArea ( Void)


Method Summary

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

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

addEventListener

public var addEventListener: Function
See the EventDispatcher Class in Flash Help

changeHandler

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

Usage:
myTextArea.changeHandler = function(){
trace("I was changed.");
}

focusHandler

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

Usage:
myTextArea.focusHandler = function(){
trace("Set focus.");
}

killFocusHandler

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

Usage:
myTextArea.killFocusHandler = function(){
trace("Kill focus.");
}

removeEventListener

public var removeEventListener: Function
See the EventDispatcher Class in Flash Help

scrollHandler

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

Usage:
myTextArea.scrollHandler = function(){
trace("Scrolling...");
}

tabFocusHandler

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

Usage:
myTextArea.tabFocusHandler = function(){
trace("Tab focus.");
}


Property Documentation

condenseWhite

public condenseWhite: Boolean (write)
Specified whether or not extra white space (spaces and returns) will be stripped out of the text. Only valid if html is set to true.

Example:
myTA.condenseWhite = false;

condenseWhite

public condenseWhite: Boolean (read)
Gets the extra white space mode of the component.

Example:
myVar = myTA.condenseWhite;

editable

public editable: Boolean (write)
Specified whether or not the user will be able to select and edit the text in the text area.

Example:
myTA.editable = false;

editable

public editable: Boolean (read)
Gets the editable mode of the component.

Example:
myVar = myTA.editable;

hscroll

public hscroll: Number (write)
Sets the current horizontal scroll value for the text field in the component, as described in the Flash help.

Example:
myTA.scroll = 10;

hscroll

public hscroll: Number (read)
Gets the current horizontal scroll value for the text field in the component, as described in the Flash help.

Example:
myVar = myTA.scroll;

maxChars

public maxChars: Number (write)
Sets the maximum number of allowable characters in the the text area. If set to 0, there will be no limitation.

Example:
myTA.maxChars = 100;

maxChars

public maxChars: Number (read)
Gets the maximum number of allowable characters in the the text area.

Example:
myVar = myTA.maxChars;

maxhscroll

public maxhscroll: Number (read-only)
Gets the current maxhscroll value for the text field in the component, as described in the Flash help.

Example:
trace(myTA.maxhscroll);

maxscroll

public maxscroll: Number (read-only)
Gets the current maxscroll value for the text field in the component, as described in the Flash help.

Example:
trace(myTA.maxscroll);

password

public password: Boolean (write)
Sets the password mode of the component. If true, text entered into the text area will not be legible, allowing for secure password entry.

Example:
myTA.password = true;

password

public password: Boolean (read)
Gets the password mode of the component.

Example:
myVar = myTA.password;

restrict

public restrict: String (write)
Restricts the characters that can be entered in the text area. See the Flash help for TextField.restrict for a full description on how to use this property. In the text area component, setting restrict to "" will allow any characters to be entered.

Example:
myTA.restrict = "0123456789"; // only these characters will be allowed.

restrict

public restrict: String (read)
Gets the character restriction of the component.

Example:
myVar = myTA.restrict.

scroll

public scroll: Number (write)
Sets the current scroll value for the text field in the component, as described in the Flash help.

Example:
myTA.scroll = 10;

scroll

public scroll: Number (read)
Gets the current scroll value for the text field in the component, as described in the Flash help.

Example:
myVar = myTA.scroll;

scrollBarWidth

public scrollBarWidth: Number (write)
Sets the width of the scrollbar used in the text area (if needed)

Example:
myTA.scrollBarWidth = 20;

scrollBarWidth

public scrollBarWidth: Number (read)
Gets the width of the scrollbar used in the text area (if needed)

Example:
myVar = myTA.scrollBarWidth;

selectable

public selectable: Boolean (write)
Specified whether or not the user will be able to select the text in the text area.

Example:
myTA.selectable = false;

selectable

public selectable: Boolean (read)
Gets the selectable mode of the component.

Example:
myVar = myTA.selectable;

text

public text: String (write)
Sets the text in the text area. This can include html tags which will be rendered if html is set to true.

Example:
myTA.text = "hello world.";

text

public text: String (read)
Gets the text displayed in the text area.

Example:
myVar = myTA.text;

textField

public textField: TextField (read-only)
Returns a reference to the text field within the text area. You can use this for lower level control of the text, such as applying style sheets, or to access properties of the text field not exposed to the component.

Example:
var tf:TextField = myTA.textField;
tf.background = true;
tf.backgroundColor = 0xffcccc;	// creates a pink background

textHeight

public textHeight: Number (read-only)
The height of the text in the the text area. This is simply the textHeight taken from the internal text field in the component.

Example:
myTA.height = myTA.textHeight + 10;

wordWrap

public wordWrap: Boolean (write)
Sets the wordWrap mode of the text area.

Example:
myTA.wordWrap = false;

wordWrap

public wordWrap: Boolean (read)
Gets the wordWrap mode of the text area.

Example:
myVar = myTA.wordWrap;


Constructor Documentation

TextArea

public function TextArea(Void)

Method Documentation

create

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

Parameters:
target
the movie clip to which the text area will be attached.
id
the instance name given to the new text area attached.
depth
the depth at which to attach the new 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 text area attached.

Example:
import com.bjc.controls.TextArea;
var newTextArea:TextArea = TextArea.create(_root, "myTextArea", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com