Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class TextInput

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


class TextInput
extends LabelWrapper

Text input component for allowing user input of text strings.

Events:

change - Fired whenever the user has changed the text in the text input 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.


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
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
maxChars: Number (write)
Sets the maximum number of allowable characters in the the text input.

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

public
password: Boolean (write)
Sets the password mode of the component. If true, text entered into the text input 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 input. See the Flash help for TextField.restrict for a full description on how to use this property. In the text input component, setting restrict to "" will allow any characters to be entered.

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

public
text: String (write)
Sets the text in the text input. 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 input.

public
textField: TextField (read-only)
Returns a reference to the text field within the text input. 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 input. This is simply the textHeight taken from the internal text field in the component.

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


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): TextInput
Static method used to create an instance of a TextInput 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:
myTextInput.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:
myTextInput.focusHandler = function(){
trace("Set focus.");
}

killFocusHandler

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

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

removeEventListener

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

tabFocusHandler

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

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


Property Documentation

maxChars

public maxChars: Number (write)
Sets the maximum number of allowable characters in the the text input.

Example:
myTI.maxChars = 100;

maxChars

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

Example:
myVar = myTI.maxChars;

password

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

Example:
myTI.password = true;

password

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

Example:
myVar = myTI.password;

restrict

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

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

restrict

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

Example:
myVar = myTI.restrict.

text

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

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

text

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

Example:
myVar = myTI.text;

textField

public textField: TextField (read-only)
Returns a reference to the text field within the text input. 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 = myTI.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 input. This is simply the textHeight taken from the internal text field in the component.

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


Constructor Documentation

TextInput

public function TextInput(Void)

Method Documentation

create

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

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

Example:
import com.bjc.controls.TextInput;
var newTextInput:TextInput = TextInput.create(_root, "myTextInput", 0);


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com