Manages text in a container. Assumes that it manages all children of the container.
Consider using TextContainerManager for better performance in cases where there is a
one container per TextFlow, and the TextFlow is not the main focus, is static text, or
is infrequently selected. Good for text in form fields, for example.
Controls whether the factory generates all text lines or stops when the container bounds are filled.
Specifies the horizontal scrolling policy, which you can set by assigning one of the constants of
the ScrollPolicy class: ON, OFF, or AUTO.
Controls whether the factory generates all text lines or stops when the container bounds are filled. Specifies the vertical scrolling policy, which you can set by assigning one of the constants of the ScrollPolicy
class: ON, OFF, or, AUTO.
Returns the inactiveSelectionFormat - by default get it from the configuration
This can be overridden in the subclass to supply a different SelectionFormat
Returns the unfocusedSelectionFormat - by default get it from the configuration
You can override this method in the subclass to supply a different SelectionFormat.
Editing mode of this TextContainerManager. Modes are reading only, reading and selection permitted,
and editing (reading, selection, and writing) permitted. Use the constant values of the EditingMode
class to set this property.
Default value is READ_WRITE.
Implementation public function get editingMode():String public function set editingMode(value:String):void
Controls whether the factory generates all text lines or stops when the container bounds are filled.
Specifies the horizontal scrolling policy, which you can set by assigning one of the constants of
the ScrollPolicy class: ON, OFF, or AUTO.
Implementation public function get horizontalScrollPolicy():String public function set horizontalScrollPolicy(value:String):void
horizontalScrollPosition
property
horizontalScrollPosition:Number
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Specifies the current horizontal scroll location on the stage. The value specifies the number of
pixels from the left.
Implementation public function get horizontalScrollPosition():Number public function set horizontalScrollPosition(value:Number):void
Sets the format when display just a string. If displaying a TextFlow this has no immediate effect. The supplied ITextLayoutFormat is not copied. Modifying it without calling this setter has indeterminate effects.
The total number of lines composed in the flow. By default TLF does not compose the entire flow and this value may be innacruate.
Use composeToPosition to get all lines composed.
Implementation public function get numLines():int
preserveSelectionOnSetText
property
preserveSelectionOnSetText:Boolean
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Implementation public function get preserveSelectionOnSetText():Boolean public function set preserveSelectionOnSetText(value:Boolean):void
Controls whether the factory generates all text lines or stops when the container bounds are filled.
Specifies the vertical scrolling policy, which you can set by assigning one of the constants of the ScrollPolicy
class: ON, OFF, or, AUTO.
Implementation public function get verticalScrollPolicy():String public function set verticalScrollPolicy(value:String):void
verticalScrollPosition
property
verticalScrollPosition:Number
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Specifies the current vertical scroll location on the stage. The value specifies the number of
pixels from the top.
Implementation public function get verticalScrollPosition():Number public function set verticalScrollPosition(value:Number):void
Constructor Detail
TextContainerManager
()
Constructor
public function TextContainerManager(container:Sprite, configuration:IConfiguration = null)
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Constructor function - creates a TextContainerManager instance.
For best results:
Start with TextContainerManager.defaultConfiguration and modify it
Share the same Configuration among many InputManagers
Parameters
container:Sprite — The DisplayObjectContainer in which to manage the text lines.
configuration:IConfiguration (default = null) — - The IConfiguration instance to use with this TextContainerManager instance.
Method Detail
activateHandler
()
method
public function activateHandler(event:Event):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the Event.ACTIVATE event when the client manages events.
Create a selection manager to use for selection. Override this method if you have a custom SelectionManager that you
want to use in place of the default.
public function deactivateHandler(event:Event):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the Event.DEACTIVATE event when the client manages events.
Parameters
event:Event — The Event object.
See also
Event.DEACTIVATE
drawBackgroundAndSetScrollRect
()
method
public function drawBackgroundAndSetScrollRect(scrollX:Number, scrollY:Number):Boolean
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Returns true if it has filled in the container's scrollRect property.
This method enables you to test whether scrollRect is set without actually accessing the scrollRect property
which can possibly create a performance issue.
Override this method to draw a background or a border. Overriding this method can be tricky as the scrollRect must
be set as specified.
Parameters
scrollX:Number — The starting horizontal position of the scroll rectangle.
scrollY:Number — The starting vertical position of the scroll rectangle.
Returns
Boolean — true if it has created the scrollRect object.
editHandler
()
method
public function editHandler(event:Event):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes an edit event (CUT, COPY, PASTE, SELECT_ALL) when the client manages events.
protected function getFocusedSelectionFormat():SelectionFormat
Returns the focusedSelectionFormat - by default get it from the configuration.
This can be overridden in the subclass to supply a different SelectionFormat
protected function getInactiveSelectionFormat():SelectionFormat
Returns the inactiveSelectionFormat - by default get it from the configuration
This can be overridden in the subclass to supply a different SelectionFormat
Return the TextLine at the index from array of composed lines.
Parameters
index:int — Finds the line at this index position in the text.
Returns
TextLine — the TextLine that occurs at the specified index.
getScrollDelta
()
method
public function getScrollDelta(numLines:int):Number
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Figure out the scroll distance required to scroll up or down by the specified number of lines.
Negative numbers scroll upward, bringing more of the top of the TextFlow into view. Positive numbers
scroll downward, bringing the next line from the bottom into full view.
When scrolling up, for example, the method makes the next line fully visible. If the next line is partially
obscured and the number of lines specified is 1, the partially obscured line becomes fully visible.
Parameters
numLines:int — The number of lines to scroll.
Returns
Number — the delta amount of space to scroll
getText
()
method
public function getText(separator:String = ):String
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Returns the current text using a separator between paragraphs.
The separator can be specified with the separator
argument. The default value of the separator argument
is the Unicode character 'PARAGRAPH SEPARATOR' (U+2029).
Calling the setter discards any attached TextFlow. Any selection is lost.
Parameters
separator:String (default = ) — String to set between paragraphs.
Returns the undo manager to use. By default, creates a unique undo manager.
You can override this method in the subclass if you want to customize the undo manager
(for example, to use a shared undo manager for multiple TextContainerManager instances).
protected function getUnfocusedSelectionFormat():SelectionFormat
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Returns the unfocusedSelectionFormat - by default get it from the configuration
You can override this method in the subclass to supply a different SelectionFormat.
public function imeStartCompositionHandler(event:IMEEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10.1, AIR 1.5
Processes the IME_START_COMPOSITION event when the client manages events.
Parameters
event:IMEEvent — The IMEEvent object.
See also
IMEEvent.IME_START_COMPOSITION
invalidateSelectionFormats
()
method
public function invalidateSelectionFormats():void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Call this if you change the selection formats (SelectionFormat) and want the interactionManager
to update.
invalidateUndoManager
()
method
public function invalidateUndoManager():void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Call this if you are editing, and want to reset the undo manager used for editing.
isDamaged
()
method
public function isDamaged():Boolean
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Returns true if the content needs composing.
Returns
Boolean — true if the content needs composing; false otherwise.
keyDownHandler
()
method
public function keyDownHandler(event:KeyboardEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the KeyboardEvent.KEY_DOWN event when the client manages events.
Parameters
event:KeyboardEvent — KeyboardEvent object.
See also
KeyboardEvent.KEY_DOWN
keyFocusChangeHandler
()
method
public function keyFocusChangeHandler(event:FocusEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the FocusEvent.KEY_FOCUS_CHANGE event when the client manages events.
Parameters
event:FocusEvent — The FocusEvent object.
keyUpHandler
()
method
public function keyUpHandler(event:KeyboardEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the Keyboard.KEY_UP event when the client manages events.
Parameters
event:KeyboardEvent — The KeyboardEvent object.
See also
KeyboardEvent.KEY_UP
menuSelectHandler
()
method
public function menuSelectHandler(event:ContextMenuEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the ContextMenuEvent.MENU_SELECT event when the client manages events.
Parameters
event:ContextMenuEvent — ContextMenuEvent object.
See also
ContextMenuEvent.MENU_SELECT
mouseDoubleClickHandler
()
method
public function mouseDoubleClickHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the MouseEvent.DOUBLE_CLICK event when the client manages events.
Parameters
event:MouseEvent — The MouseEvent object.
See also
MouseEvent.DOUBLE_CLICK
mouseDownHandler
()
method
public function mouseDownHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the MouseEvent.MOUSE_DOWN event when the client manages events.
Parameters
event:MouseEvent — The MouseEvent object.
See also
MouseEvent.MOUSE_DOWN
mouseMoveHandler
()
method
public function mouseMoveHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the MouseEvent.MOUSE_MOVE event when the client manages events.
Parameters
event:MouseEvent — The MouseEvent object.
See also
MouseEvent.MOUSE_MOVE
mouseMoveSomewhere
()
method
public function mouseMoveSomewhere(e:Event):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Client call to forward a mouseMove event from outside a security sandbox. Coordinates of the mouse move are not needed.
Parameters
e:Event
mouseOutHandler
()
method
public function mouseOutHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the MouseEvent.MOUSE_OUT event when the client manages events.
Parameters
event:MouseEvent — The MouseEvent object.
See also
MouseEvent.MOUSE_OUT
mouseOverHandler
()
method
public function mouseOverHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Process a mouseOver event.
Parameters
event:MouseEvent
See also
MouseEvent.MOUSE_OVER
mouseUpHandler
()
method
public function mouseUpHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the MouseEvent.MOUSE_UP event when the client manages events.
Parameters
event:MouseEvent — The MouseEvent object.
See also
MouseEvent.MOUSE_UP
mouseUpSomewhere
()
method
public function mouseUpSomewhere(e:Event):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Client call to forward a mouseUp event from outside a security sandbox. Coordinates of the mouse up are not needed.
Parameters
e:Event
mouseWheelHandler
()
method
public function mouseWheelHandler(event:MouseEvent):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Processes the MouseEvent.MOUSE_WHEEL event when the client manages events.
Parameters
event:MouseEvent — The MouseEvent object.
See also
MouseEvent.MOUSE_WHEEL
resetLine
()
method
public function resetLine(textLine:TextLine):void
Parameters
textLine:TextLine
scrollToRange
()
method
public function scrollToRange(activePosition:int, anchorPosition:int):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Scrolls so that the text range is visible in the container.
Parameters
activePosition:int — The end of the selection that is changed when you extend the selection. It can be
either the start or the end of the selection, expressed as an offset from the start of the text flow.
anchorPosition:int — The stable end of the selection when you extend the selection. It can be either
the start or the end of the selection.
setText
()
method
public function setText(text:String):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Sets the text property to the specified String.
Discards any attached TextFlow. Any selection is lost.
Parameters
text:String — the String to set
setTextFlow
()
method
public function setTextFlow(textFlow:TextFlow):void
Language Version :
ActionScript 3.0
Runtime Versions :
Flash Player 10, AIR 1.5
Sets a TextFlow into this TextContainerManager replacing any existing TextFlow and discarding the
current text.
Defines the value of the type property of a flowOperationBegin event object.
Dispatched before an operation is executed. Cancelling this event blocks the operation.
Defines the value of the type property of a flowOperationComplete event object.
Dispatched after all operations including pending and composite operations are completed, composition is finished and the display is scrolled.
Defines the value of the type property of a flowOperationEnd event object.
Dispatched after an operation completes. Any errors are stored in OperationEvent.error.
If there is an error, cancelling this event blocks the rethrow of the error.
Generally speaking all errors are likely to be fatal.
Changing an operation at this time (after it has been executed) may fail.