Property | Defined by | ||
---|---|---|---|
_lastSelected : TextField [static] The last tracked TextField to be selected.
| TextFieldUtil | ||
_mouseables : Dictionary [static]
| TextFieldUtil |
Method | Defined by | ||
---|---|---|---|
createField(text:String, initProps:Object = null, formatProps:Object = null, clazz:Class = null):TextField
[static]
Create a TextField.
| TextFieldUtil | ||
createFormat(initProps:Object):TextFormat
[static]
Create a TextFormat using initProps.
| TextFieldUtil | ||
setFocusable(field:TextField):void
[static]
Add a special MouseEvent.CLICK listener so that the specified field is focusable
even inside a security boundary.
| TextFieldUtil | ||
setMaximumTextWidth(tf:TextField, width:Number, truncationString:String = "..."):Boolean
[static]
Ensures that a single-line TextField is not wider than the specified width, and
truncates it with the truncation string if is.
| TextFieldUtil | ||
trackOnlyLinksMouseable(textField:TextField, on:Boolean = true):void
[static]
Install listeners on the specified TextField such that the mouseEnabled property
is only true when the mouse is over a link.
| TextFieldUtil | ||
trackSingleSelectable(textField:TextField):void
[static]
Include the specified TextField in a set of TextFields in which only
one may have a selection at a time.
| TextFieldUtil | ||
updateFormat(field:TextField, props:Object):void
[static]
Update the defaultTextFormat for the specified field, as well as all text therein.
| TextFieldUtil | ||
updateText(field:TextField, text:String):void
[static]
Update the text in the field, automatically resizing it if appropriate.
| TextFieldUtil |
Method | Defined by | ||
---|---|---|---|
handleFieldFocus(event:MouseEvent):void
[static]
Handle focusing the text field.
| TextFieldUtil | ||
handleLastSelectedRemoved(... ignored):void
[static]
Internal method related to tracking a single selectable TextField.
| TextFieldUtil | ||
handleTrackedSelection(event:MouseEvent):void
[static]
Internal method related to tracking a single selectable TextField.
| TextFieldUtil | ||
handleTrackMouseable(event:Event):void
[static]
Checks every damn frame to see if we should make a TextField mouse-enabled.
| TextFieldUtil | ||
updateSelection(field:TextField):void
[static]
Process the selection.
| TextFieldUtil |
Constant | Defined by | ||
---|---|---|---|
HEIGHT_PAD : int = 4 [static] A fudge factor that must be added to a TextField's textHeight when setting the height.
| TextFieldUtil | ||
WIDTH_PAD : int = 5 [static] A fudge factor that must be added to a TextField's textWidth when setting the width.
| TextFieldUtil |
Constant | Defined by | ||
---|---|---|---|
DEFAULT_FORMAT_PROPS : Object [static]
| TextFieldUtil | ||
_frameDispatcher : Sprite [static]
| TextFieldUtil | ||
MASK_FIELD_PROPS : Object [static]
| TextFieldUtil |
_lastSelected | property |
protected static var _lastSelected:TextField
The last tracked TextField to be selected.
_mouseables | property |
protected static var _mouseables:Dictionary
createField | () | method |
public static function createField(text:String, initProps:Object = null, formatProps:Object = null, clazz:Class = null):TextField
Create a TextField. The field will have setFocusable() called on it. Note that if the autoSize property is not none, then the field will be resized to the size of the text, overwriting any width/height properties specified.
Parameterstext:String — contains properties with which to initialize the TextField.
Additionally it may contain the following properties: outlineColor: uint, outlineWidth: Number (default 2), outlineStrength: Number (default 255) |
|
initProps:Object (default = null ) — contains properties with which to initialize the defaultTextFormat.
|
|
formatProps:Object (default = null )
|
|
clazz:Class (default = null )
|
TextField |
createFormat | () | method |
public static function createFormat(initProps:Object):TextFormat
Create a TextFormat using initProps. If unspecified, the following properties have default values: size: 18 font: _sans
ParametersinitProps:Object |
TextFormat |
handleFieldFocus | () | method |
protected static function handleFieldFocus(event:MouseEvent):void
Handle focusing the text field.
Parametersevent:MouseEvent |
handleLastSelectedRemoved | () | method |
protected static function handleLastSelectedRemoved(... ignored):void
Internal method related to tracking a single selectable TextField.
Parameters... ignored |
handleTrackedSelection | () | method |
protected static function handleTrackedSelection(event:MouseEvent):void
Internal method related to tracking a single selectable TextField.
Parametersevent:MouseEvent |
handleTrackMouseable | () | method |
protected static function handleTrackMouseable(event:Event):void
Checks every damn frame to see if we should make a TextField mouse-enabled.
Parametersevent:Event |
setFocusable | () | method |
public static function setFocusable(field:TextField):void
Add a special MouseEvent.CLICK listener so that the specified field is focusable even inside a security boundary.
Parametersfield:TextField |
setMaximumTextWidth | () | method |
public static function setMaximumTextWidth(tf:TextField, width:Number, truncationString:String = "..."):Boolean
Ensures that a single-line TextField is not wider than the specified width, and truncates it with the truncation string if is. If the TextField is truncated, it will be resized to its new textWidth.
Parameterstf:TextField — the maximum pixel width of the TextField. If tf.width > width,
the text inside the TextField will be truncated, and will have the truncation string
appended.
|
|
width:Number — the string to append to the end of the TextField if it exceeds
the specified width.
|
|
truncationString:String (default = "... ")
|
Boolean — true if truncation took place
|
trackOnlyLinksMouseable | () | method |
public static function trackOnlyLinksMouseable(textField:TextField, on:Boolean = true):void
Install listeners on the specified TextField such that the mouseEnabled property is only true when the mouse is over a link.
ParameterstextField:TextField |
|
on:Boolean (default = true )
|
trackSingleSelectable | () | method |
public static function trackSingleSelectable(textField:TextField):void
Include the specified TextField in a set of TextFields in which only one may have a selection at a time.
ParameterstextField:TextField |
updateFormat | () | method |
public static function updateFormat(field:TextField, props:Object):void
Update the defaultTextFormat for the specified field, as well as all text therein.
Parametersfield:TextField |
|
props:Object |
updateSelection | () | method |
protected static function updateSelection(field:TextField):void
Process the selection.
Parametersfield:TextField |
updateText | () | method |
public static function updateText(field:TextField, text:String):void
Update the text in the field, automatically resizing it if appropriate.
Parametersfield:TextField |
|
text:String |
DEFAULT_FORMAT_PROPS | constant |
protected static const DEFAULT_FORMAT_PROPS:Object
_frameDispatcher | constant |
protected static const _frameDispatcher:Sprite
HEIGHT_PAD | constant |
public static const HEIGHT_PAD:int = 4
A fudge factor that must be added to a TextField's textHeight when setting the height.
MASK_FIELD_PROPS | constant |
protected static const MASK_FIELD_PROPS:Object
WIDTH_PAD | constant |
public static const WIDTH_PAD:int = 5
A fudge factor that must be added to a TextField's textWidth when setting the width.