The IFlowComposer interface defines the TextLayout display controller, which manages the composition and display
of the text flow.
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():intnumLines: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():introotElement: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 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
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. |
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
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. |
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. |
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. |
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. |
ReturnsThrows | RangeError — If Controller is not found at the location specified by the index. |
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
Returns | int — the index position of the IContainerController instance being sought or -1 if it is not found. |
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. |
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.
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. |
public function removeAllControllers():voidRemove all controllers from this IFlowComposer instance.
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
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. |
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. |
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.
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. |
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
Returns | Boolean — true if anything changed. |
© 2004-2008 Adobe Systems Incorporated. All rights reserved.
Thu Nov 20 2008, 04:03 AM -08:00
Current page: http://livedocs.adobe.com/labs/textlayout/flashx/textLayout/compose/IFlowComposer.html