Packageflashx.textLayout.compose
Interfacepublic interface IFlowComposer
Implementors StandardFlowComposer

The IFlowComposer interface defines the TextLayout display controller, which manages the composition and display of the text flow.

IFlowComposer

See also

flashx.textLayout.container.IContainerController
FlowComposerBase
StandardFlowComposer
TextFlow


Public Properties
 PropertyDefined By
  numControllers : int
[read-only] Returns the number of container controllers.
IFlowComposer
  numLines : int
[read-only] Returns the number of lines.
IFlowComposer
  rootElement : ContainerFormattedElement
[read-only] Returns the root element associated with this IFlowComposer instance.
IFlowComposer
Public Methods
 MethodDefined By
  
Adds a controller to this IFlowComposer instance.
IFlowComposer
  
Adds a controller to this IFlowComposer instance at the location specified by an index.
IFlowComposer
  
Composes the content of the root element, if it has changed since it was last composed.
IFlowComposer
  
findControllerIndexAtPosition(characterPosition:int, preferPrevious:Boolean = false):int
Returns the index of the controller containing the specified character position.
IFlowComposer
  
findLineAtPosition(absolutePos:int, preferPrevious:Boolean = false):TextFlowLine
Returns the TextFlowLine containing the specified position.
IFlowComposer
  
findLineIndexAtPosition(absolutePosition:int, preferPrevious:Boolean = false):int
Returns the index of the TextFlowLine that contains the specified position.
IFlowComposer
  
Returns the container controller at the specified index location.
IFlowComposer
  
Finds the specified container controller and returns its position as an index.
IFlowComposer
  
Returns the line at the specified index of the text lines.
IFlowComposer
  
Removes the selection drawing - either a blinking cursor or a block - from the display.
IFlowComposer
  
isDamaged(absolutePos:int, textLength:int):Boolean
Determines whether the TextFlowLines that contain any character in the range are marked as damaged
IFlowComposer
  
Remove all controllers from this IFlowComposer instance.
IFlowComposer
  
Removes a apecified controller from this IFlowComposer instance.
IFlowComposer
  
Removes the controller at the specified index position from this IFlowComposer instance.
IFlowComposer
  
setFocus(absolutePosition:int, preferPrevious:Boolean = false):void
Sets the focus to the container that contains the location specified by the absolutePosition parameter.
IFlowComposer
  
Draws the selection - either a blinking cursor or a block.
IFlowComposer
  
Composes any damaged contents in the root element and updates the display.
IFlowComposer
  
Does just enough composition and update to ensure that the display for the specified container is current.
IFlowComposer
Property Detail
numControllersproperty
numControllers:int  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the number of container controllers.



Implementation
    public function get numControllers():int
numLinesproperty 
numLines:int  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the number of lines.



Implementation
    public function get numLines():int
rootElementproperty 
rootElement:ContainerFormattedElement  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the root element associated with this IFlowComposer instance. A TextFlow object is an example of a root element.



Implementation
    public function get rootElement():ContainerFormattedElement
Method Detail
addController()method
public function addController(controller:IContainerController):void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Adds a controller to this IFlowComposer instance.

Parameters

controller:IContainerController — The container controller instance to add.

addControllerAt()method 
public function addControllerAt(controller:IContainerController, index:int):void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Adds a controller to this IFlowComposer instance at the location specified by an index.

Parameters

controller:IContainerController — The container controller instance to add.
 
index:int — A numeric index that specifies the location at which to add the controller container.

compose()method 
public function compose():Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Composes the content of the root element, if it has changed since it was last composed. After this call, all of the lines have been updated in the flowComposer but the display might still be out of date. Generally, this call is useful for testing or for checking the results of composition before calling updateAllContainers() .

Text containers have two phases, composition and display. Composition calculates how many lines of text there are and where each one belongs. The results are saved between runs, and only the changed text is composed the next time.

Returns
Boolean — true if anything changed.

See also

findControllerIndexAtPosition()method 
public function findControllerIndexAtPosition(characterPosition:int, preferPrevious:Boolean = false):int

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the index of the controller containing the specified character position. TextLayout maps the specified character position as being immediately before the specified character. If the specified position is the first character in a container and the preferPrevious parameter is set to true , this function returns the previous container.

Parameters

characterPosition:int — Numeric index of the character position for which the controller container index is sought.
 
preferPrevious:Boolean (default = false) — Match previous container if at exact limit of container.

Returns
int — the index of the container controller or -1 if not found.
findLineAtPosition()method 
public function findLineAtPosition(absolutePos:int, preferPrevious:Boolean = false):TextFlowLine

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the TextFlowLine containing the specified position.

Parameters

absolutePos:int — The position for which you want the text line.
 
preferPrevious:Boolean (default = false) — Indicates whether you want the previous TextFlowLine, if at the beginning of a TextFlowLine.

Returns
TextFlowLine — the TextFlowLine at the specified position, or null if not found.
findLineIndexAtPosition()method 
public function findLineIndexAtPosition(absolutePosition:int, preferPrevious:Boolean = false):int

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the index of the TextFlowLine that contains the specified position. The first position is 0 and the last position is the number of lines minus 1.

Parameters

absolutePosition:int — The position for which you want the text line.
 
preferPrevious:Boolean (default = false) — Indicates whether you want the previous container, if at the beginning of a TextFlowLine.

Returns
int — the index of the text line at the specified position. If not found, treats as past the end and returns the number of lines.
getControllerAt()method 
public function getControllerAt(controllerIndex:int):IContainerController

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the container controller at the specified index location.

Parameters

controllerIndex:int — The location of the container controller to return.

Returns
IContainerController — the container controller at the specified position.

Throws
RangeError — If Controller is not found at the location specified by the index.
getControllerIndex()method 
public function getControllerIndex(controller:IContainerController):int

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Finds the specified container controller and returns its position as an index.

Parameters

controller:IContainerController — The IContainerController instance to find.

Returns
int — the index position of the IContainerController instance being sought or -1 if it is not found.
getLineAt()method 
public function getLineAt(lineIndex:int):TextFlowLine

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns the line at the specified index of the text lines.

Parameters

lineIndex:int — Index of the line you want among text lines.

Returns
TextFlowLine — the TextFlowLine that occurs at the specified index of lines, or null if not found.
hideSelection()method 
public function hideSelection():void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Removes the selection drawing - either a blinking cursor or a block - from the display.

isDamaged()method 
public function isDamaged(absolutePos:int, textLength:int):Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Determines whether the TextFlowLines that contain any character in the range are marked as damaged

Parameters

absolutePos:int — character position from which to begin looking for damaged lines.
 
textLength:int — Length of text in which to look for damaged lines.

Returns
Boolean — true if any of the TextFlowLines are marked as damaged.
removeAllControllers()method 
public function removeAllControllers():void

Remove all controllers from this IFlowComposer instance.

removeController()method 
public function removeController(controller:IContainerController):void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Removes a apecified controller from this IFlowComposer instance.

Parameters

controller:IContainerController — The IContainerController instance to remove.

removeControllerAt()method 
public function removeControllerAt(index:int):void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Removes the controller at the specified index position from this IFlowComposer instance.

Parameters

index:int — The location at which to remove the IContainerController instance.

setFocus()method 
public function setFocus(absolutePosition:int, preferPrevious:Boolean = false):void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Sets the focus to the container that contains the location specified by the absolutePosition parameter.

Parameters

absolutePosition:int — Specifies the position in the text flow of the container to receive focus.
 
preferPrevious:Boolean (default = false) — If true and the position is the first character in a container, sets focus to the end of the previous container.

showSelection()method 
public function showSelection():void

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Draws the selection - either a blinking cursor or a block. Uses the SelectionFormat values defined by the SelectionManager for drawing the selection.

updateAllContainers()method 
public function updateAllContainers():Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Composes any damaged contents in the root element and updates the display.

Text containers have two phases, composition and display. Composition is the first phase, which determines how many lines there are and calculates the location of each of them. The results are saved between runs and only the changed text is recomposed the next time. The second phase is to update the display list.

This method updates all the text lines and the display list immediately and synchronously.

Returns
Boolean — true if anything changed.
updateContainer()method 
public function updateContainer(container:IContainerController):Boolean

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Does just enough composition and update to ensure that the display for the specified container is current. If you have a chain of twenty containers and specify the tenth container, updateContainer() ensures that containers 1 - 10 are properly composed and displayed. Composition stops at that point and you cannot assume that the following containers are correctly displayed.

Parameters

container:IContainerController

Returns
Boolean — true if anything changed.




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/textlayout/flashx/textLayout/compose/IFlowComposer.html