flashx.textLayout.composeStandardFlowComposer The StandardFlowComposer class provides a standard composer and container manager.flashx.textLayout.compose:IFlowComposerflashx.textLayout.compose:FlowComposerBase The StandardFlowComposer class provides a standard composer and container manager.

Each call to compose() or updateAllControllers() normalizes the text flow as a first step. The normalizing process checks the parts of the TextFlow object that were modified and takes the following steps:

  1. Deletes empty FlowLeafElement and SubParagraphGroupElement objects.
  2. Merges sibling spans that have identical attributes.
  3. Adds an empty paragraph if a flow is empty.

To use a StandardFlowComposer, assign it to the flowComposer property of a TextFlow object. Call the updateAllControllers() method to lay out and display the text in the containers attached to the flow composer.

Note: For simple, static text flows, you can also use the one of the text line factory classes. These factory classes will typically create lines with less overhead than a flow composer, but do not support editing, dynamic changes, or user interaction.

flashx.textLayout.elements.TextFlow.flowComposerStandardFlowComposer Creates a StandardFlowComposer object. Creates a StandardFlowComposer object.

To use an StandardFlowComposer object, assign it to the flowComposer property of a TextFlow object. Call the updateAllControllers() method to lay out and display the text in the containers attached to the flow composer.

addControllerAt controllerflashx.textLayout.container:ContainerControllerThe ContainerController object to add. indexA numeric index that specifies the position in the controller list at which to insert the ContainerController object. addController controllerflashx.textLayout.container:ContainerControllerThe ContainerController object to add. composeToController true if anything changed. indexunknowncompose at least up to this container in the TextFlow. If controllerIndex is greater than the number of controllers, compose to the end of the last container. composeToPosition true if anything changed. absolutePositionunknowncompose at least up to this position in the TextFlow. By default or if absolutePosition is past the end of the flow compose to the end of the flow. compose Calculates how many lines are necessary to display the content in the root element of the flow and the positions of these lines in the flow's display containers.true if anything changed. Calculates how many lines are necessary to display the content in the root element of the flow and the positions of these lines in the flow's display containers.

The compose() method only composes content if it has changed since the last composition operation. Results are saved so that subsequent calls to compose() or updateAllControllers() do not perform an additional recomposition if the flow content has not changed.

If the contents of any container have changed, the method returns true.

updateAllControllers()updateToController()
findControllerIndexAtPosition Returns the index of the controller containing the content at the specified position.the index of the container controller or -1 if not found. absolutePositionThe position of the content for which the container index is sought. preferPreviousfalseSpecifies which container index to return when the position is between the last element in one container and the first element in the next. Returns the index of the controller containing the content at the specified position.

A position can be considered to be the division between two characters or other elements of a text flow. If the value in absolutePosition is a position between the last character of one container and the first character of the next, then the preceding container is returned if the preferPrevious parameter is set to true and the later container is returned if the preferPrevious parameter is set to false.

The method returns -1 if the content at the specified position is not in any container or is outside the range of positions in the text flow.

getAbsoluteStart Returns the absolute position of the first content element in the specified ContainerController object.the position before the first character or graphic in the ContainerController. controllerflashx.textLayout.container:ContainerControllerA ContainerController object associated with this flow composer. Returns the absolute position of the first content element in the specified ContainerController object.

A position is calculated by counting the division between two characters or other elements of a text flow. The position preceding the first element of a flow is zero. An absolute position is the position counting from the beginning of the flow.

getControllerAt flashx.textLayout.container:ContainerControllerthe ContainerController object at the specified position. indexThe index of the ContainerController object to return. getControllerIndex version AIR 1.5 the index of the specified ContainerController object or -1 if the controller is not attached to this flow composer. controllerflashx.textLayout.container:ContainerControllerA reference to the ContainerController object to find. interactionManagerChanged Called by the TextFlow when the interaction manager changes.newInteractionManagerflashx.textLayout.edit:ISelectionManagerThe new ISelectionManager instance. Called by the TextFlow when the interaction manager changes.

This function is called automatically. Your code does not typically need to call this method. Classes that extend StandardFlowComposer can override this method to update event listeners and other properties that depend on the interaction manager.

preCompose Returns true if composition is necessary, false otherwise Returns true if composition is necessary, false otherwise removeAllControllers removeControllerAt indexThe index of the ContainerController object to remove. removeController controllerflashx.textLayout.container:ContainerControllerThe ContainerController instance to remove. setFocus Sets the focus to the container that contains the location specified by the absolutePosition parameter.absolutePositionSpecifies the position in the text flow of the container to receive focus. leanLeftfalseIf true and the position is before the first character in a container, sets focus to the end of the previous container. Sets the focus to the container that contains the location specified by the absolutePosition parameter.

The StandardFlowComposer calls the setFocus() method of the ContainerController object containing the specified text flow position.

flash.display.Stage.focus
setRootElement newRootElementflashx.textLayout.elements:ContainerFormattedElement updateAllControllers Composes the content of the root element and updates the display.true if anything changed. Composes the content of the root element and updates the display.

Text layout is conducted in two phases: composition and display. In the composition phase, the flow composer calculates how many lines are necessary to display the content as well as the position of these lines in the flow's display containers. In the display phase, the flow composer updates the display object children of its containers. The updateAllControllers() method initiates both phases in sequence. The StandardFlowComposer keeps track of changes to content so that a full cycle of composition and display is only performed when necessary.

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

If the contents of any container is changed, the method returns true.

updateToController Composes and updates the display up to and including the container at the specified index.true, if anything changed. indexunknownindex of the last container to update (by default updates all containers) Composes and updates the display up to and including the container at the specified index.

The updateToController() method composes the content and updates the display of all containers up to and including the container at the specified index. For example, if you have a chain of 20 containers and specify an index of 10, updateToController() ensures that the first through the tenth (indexes 0-9) containers are composed and displayed. Composition stops at that point. If controllerIndex is -1 (or not specified), then all containers are updated.

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

If the contents of any container is changed, the method returns true.

composing True, if the flow composer is currently performing a composition operation. True, if the flow composer is currently performing a composition operation. numControllers rootElement flashx.textLayout.elements:ContainerFormattedElement
TextFlowLineLocation The TextFlowLineLocation class is an enumeration class that defines constants for specifying the location of a line within a paragraph.Object The TextFlowLineLocation class is an enumeration class that defines constants for specifying the location of a line within a paragraph. ParagraphElementTextFlowFIRST Specifies the first line in a paragraph.1 Specifies the first line in a paragraph. LAST Specifies the last line in a paragraph.4 Specifies the last line in a paragraph. MIDDLE Specifies a middle line in a paragraph - neither the first nor the last line.2 Specifies a middle line in a paragraph - neither the first nor the last line. ONLY Specifies both the first and last lines in a paragraph.5 Specifies both the first and last lines in a paragraph. FlowComposerBase The FlowComposerBase class is the base class for Text Layout Framework flow composer classes, which control the composition of text lines in ContainerController objects.Object The FlowComposerBase class is the base class for Text Layout Framework flow composer classes, which control the composition of text lines in ContainerController objects.

FlowComposerBase is a utility class that implements methods and properties that are common to several types of flow composer. Application code would not typically instantiate or use this class (unless extending it to create a custom flow composer).

flashx.textLayout.elements.TextFlow.flowComposerFlowComposerBase Constructor. Constructor. damage startPositionbeginning of range to damage damageLengthnumber of characters to damage damageTypetype of damage. One of flashx.textLayout.compose.FlowDamageType findLineAtPosition flashx.textLayout.compose:TextFlowLinethe TextFlowLine containing the content at the specified position, or null if not found. absolutePositionThe position of the content for which you want the TextFlowLine object. preferPreviousfalse Specifies which line to return when the position is between the last element of one line and the first element of the next. findLineIndexAtPosition the index of the text line at the specified position. If not found, treats as past the end and returns the number of lines. absolutePositionThe position of the content for which you want the text line. preferPreviousfalseSpecifies which container index to return when the position is between the last line in one container and the first line in the next. getLineAt flashx.textLayout.compose:TextFlowLinethe TextFlowLine with the specified line number, or null, if not found. index The line number of the TextFlowLine object to return. isDamaged true if any of the TextFlowLine objects from the start of the flow up to the line containing the content at absolutePosition are marked as damaged. absolutePositionthe last position in the area of interest updateLengths startPositionbeginning of change in length deltaLengthchange in number of characters. damageAbsoluteStart The absolute position immediately preceding the first element in the text flow that requires composition and updating. The absolute position immediately preceding the first element in the text flow that requires composition and updating. numLines swfContext The ISWFContext instance used to make FTE calls as needed.flashx.textLayout.compose:ISWFContext The ISWFContext instance used to make FTE calls as needed.

By default, the ISWFContext implementation is this FlowComposerBase object. Applications can provide a custom implementation to use fonts embedded in a different SWF file or to cache and reuse text lines.

flashx.textLayout.compose.ISWFContext
textFlow The TextFlow object to which this flow composer is attached.flashx.textLayout.elements:TextFlow The TextFlow object to which this flow composer is attached. flashx.textLayout.elements.TextFlow
TextLineRecycler The TextLineRecycler class provides support for recycling of TextLines.Object The TextLineRecycler class provides support for recycling of TextLines. Some player versions support a recreateTextLine. Passing TextLines to the recycler makes them available for reuse. This improves Player performance. addLineForReuse Add a TextLine to the pool for reuse.textLine Add a TextLine to the pool for reuse. TextLines for reuse should have null userData and null parent. getLineForReuse Return a TextLine from the pool for reuse. Return a TextLine from the pool for reuse. textLineRecyclerEnabled Controls if the TLF recycler enabled. Controls if the TLF recycler enabled. It can only be enabled in 10.1 or later players. TextFlowLine The TextFlowLine class represents a single line of text in a text flow.flashx.textLayout.compose:IVerticalJustificationLineObject The TextFlowLine class represents a single line of text in a text flow.

Use this class to access information about how a line of text has been composed: its position, height, width, and so on. When the text flow (TextFlow) is modified, the lines immediately before and at the site of the modification are marked as invalid because they need to be recomposed. Lines after the site of the modification might not be damaged immediately, but they might be regenerated once the text is composed. You can access a TextFlowLine that has been damaged, but any values you access reflect the old state of the TextFlow. When the TextFlow is recomposed, it generates new lines and you can get the new line for a given position by calling TextFlow.flowComposer.findLineAtPosition().

TextFlowLine Constructor - creates a new TextFlowLine instance.textLineThe TextLine display object to use for this line. paragraphflashx.textLayout.elements:ParagraphElementThe paragraph (ParagraphElement) in which to place the line. outerTargetWidth0The width the line is composed to, excluding indents. lineOffset0The line's offset in pixels from the appropriate container inset (as dictated by paragraph direction and container block progression), prior to alignment of lines in the paragraph. absoluteStart0The character position in the text flow at which the line begins. numChars0The number of characters in the line. Constructor - creates a new TextFlowLine instance.

Note: No client should call this. It's exposed for writing your own composer.

flash.text.engine.TextLineflashx.textLayout.elements.ParagraphElementabsoluteStart
getBounds Returns the bounds of the line as a rectangle.a rectangle that represents the boundaries of the line. Returns the bounds of the line as a rectangle. getTextLine Returns the flash.text.engine.TextLine object for this line, which might be recreated if it does not exist due to garbage collection.object for this line or null if the TextLine object cannot be recreated. forceValidfalseif true, the TextLine is regenerated, if it exists but is invalid. Returns the flash.text.engine.TextLine object for this line, which might be recreated if it does not exist due to garbage collection. Set forceValid to true to cause the TextLine to be regenerated. Returns null if the TextLine cannot be recreated. TextLineabsoluteStart The location of the line as an absolute character position in the TextFlow object. The location of the line as an absolute character position in the TextFlow object. flashx.textLayout.elements.TextFlowascent columnIndex The number of the column in which the line has been placed, with the first column being 0. The number of the column in which the line has been placed, with the first column being 0. controller The controller (ContainerController object) for the container in which the line has been placed.flashx.textLayout.container:ContainerController The controller (ContainerController object) for the container in which the line has been placed. flashx.textLayout.container.ContainerControllerdescent height The height of the line in pixels. The height of the line in pixels. lineOffset The line's offset in pixels from the appropriate container inset (as dictated by paragraph direction and container block progression), prior to alignment of lines in the paragraph. The line's offset in pixels from the appropriate container inset (as dictated by paragraph direction and container block progression), prior to alignment of lines in the paragraph. location One of the values from TextFlowLineLocation for specifying a line's location within a paragraph. One of the values from TextFlowLineLocation for specifying a line's location within a paragraph. flashx.textLayout.elements.ParagraphElementTextFlowLineLocationparagraph The paragraph (ParagraphElement) in which the line resides.flashx.textLayout.elements:ParagraphElement The paragraph (ParagraphElement) in which the line resides. flashx.textLayout.elements.ParagraphElementspaceAfter The amount of space to leave after the line. The amount of space to leave after the line.

If the line is the last line of a paragraph that has a space-after, the line will have a spaceAfter value. If the line comes at the bottom of a column, then the spaceAfter is ignored. Otherwise, the line comes before another line in the column, and the following line must be positioned vertically to insure that there is at least this much space left between this last line of the paragraph and the first line of the following paragraph.

TextLayoutFormat.paragraphSpaceAfter
spaceBefore The amount of space to leave before the line. The amount of space to leave before the line.

If the line is the first line of a paragraph that has a space-before applied, the line will have a spaceBefore value. If the line comes at the top of a column, spaceBefore is ignored. Otherwise, the line follows another line in the column, and it is positioned vertically to insure that there is at least this much space left between this line and the last line of the preceding paragraph.

TextLayoutFormat.paragraphSpaceBefore
textHeight The height of the text line, which is equal to ascent plus descent. The height of the text line, which is equal to ascent plus descent. The value is calculated based on the difference between the baselines that bound the line, either ideographic top and bottom or ascent and descent depending on whether the baseline at y=0 is ideographic (for example, TextBaseline.IDEOGRAPHIC_TOP) or not. TextBaselinetextLength The number of characters to the next line, including trailing spaces. The number of characters to the next line, including trailing spaces. textLineExists Indicates whether the flash.text.engine.TextLine object for this TextFlowLine exists. Indicates whether the flash.text.engine.TextLine object for this TextFlowLine exists. The value is true if the TextLine object has not been garbage collected and false if it has been. TextLineunjustifiedTextWidth The width of the line if it was not justified.TBD: add graphic of justified line The width of the line if it was not justified. For unjustified text, this value is the same as textLength. For justified text, this value is what the length would have been without justification, and textLength represents the actual line width. For example, when the following String is justified and assigned a width of 500, it has an actual width of 500 but an unjustified width of 268.9921875. validity The validity of the line. The validity of the line.

A line can be invalid if the text, the attributes applied to it, or the controller settings have changed since the line was created. An invalid line can still be displayed, and you can use it, but the values used will be the values at the time it was created. The line returned by getTextLine() also will be in an invalid state.

getTextLine()TextLine.validityFlowDamageType.GEOMETRY
x The horizontal position of the line relative to its container, expressed as the offset in pixels from the left of the container. The horizontal position of the line relative to its container, expressed as the offset in pixels from the left of the container.

Note: Although this property is technically read-write, you should treat it as read-only. The setter exists only to satisfy the requirements of the IVerticalJustificationLine interface that defines both a getter and setter for this property. Use of the setter, though possible, will lead to unpredictable results.

y
y The vertical position of the line relative to its container, expressed as the offset in pixels from the top of the container. The vertical position of the line relative to its container, expressed as the offset in pixels from the top of the container.

Note: Although this property is technically read-write, you should treat it as read-only. The setter exists only to satisfy the requirements of the IVerticalJustificationLine interface that defines both a getter and setter for this property. Use of the setter, though possible, will lead to unpredictable results.

x
FlowDamageType The FlowDamageType class is an enumeration class that defines types of damage for damage methods and events.Object The FlowDamageType class is an enumeration class that defines types of damage for damage methods and events. When the text content is updated, these changes are reflected in the TextLines after an update. TextLines are marked with a flag that specifies whether or not they are valid, or up to date with all text changes. When the text is first updated, all lines are marked valid or static. After the text has been changed, and before the next update, lines will be marked with a FlowDamageType that specifies what about the line is invalid. Once the update is done, lines will again be marked as valid or static. GEOMETRY Value is used to set the validity property if the line has been invalidated by other lines moving around.geometry Value is used to set the validity property if the line has been invalidated by other lines moving around. For instance, a line above may have been created, so this line needs to be moved down. The text line might or might not need recreating at the next compose operation. flashx.textLayout.compose.TextFlowLine.validityINVALID Value is used to set the validity property if the text content has changed since the line was originally created.invalid Value is used to set the validity property if the text content has changed since the line was originally created. Invalid lines needs to be recreated before they are used for selection or to display the text content changes. flashx.textLayout.compose.TextFlowLine.validityIFlowComposer IFlowComposer defines the interface for managing the layout and display of a text flow. IFlowComposer defines the interface for managing the layout and display of a text flow.

Text flows displayed with a flow composer implementation can be dynamic and interactive. A flow composer manages one or more display controller. Each controller is associated with a display object container (such as a Sprite) through which the lines created for the text flow are ultimately displayed. The following diagram illustrates the relationship between TextFlow, IFlowComposer, ContainerController, and DisplayObjectContainer objects:

A flow composer calculates which portion of a text flow fits in each container and adds the appropriate text lines to the container's display object. The IFlowComposer interface defines separate methods for layout calculations and for updating the display. IFlowComposer also defines methods for incrementally composing and updating a text flow. These methods can be used to avoid blocking the user interface when updating long text flows.

In addition to managing text composition and display, a flow composer controls which container has focus, manages the display of the selection highlight (which can cross container boundaries), and provides direct access to all the TextLine objects in the flow.

To use an IFlowComposer implementation, assign an instance of that implementation to the flowComposer property of a TextFlow object. Call the updateAllControllers() method to lay out and display the text in the containers attached to the flow composer.

Note: For simple, static text flows, you can also use the one of the text line factory classes. These factory classes will typically create lines with less overhead than a flow composer, but do not support editing, dynamic changes, or user interaction.

ContainerControllerFlowComposerBaseStandardFlowComposerTextFlowStringTextLineFactoryTextFlowTextLineFactoryaddControllerAt Adds a controller to this IFlowComposer instance at the specified index.controllerflashx.textLayout.container:ContainerControllerThe ContainerController object to add. indexA numeric index that specifies the position in the controller list at which to insert the ContainerController object. Adds a controller to this IFlowComposer instance at the specified index.

The list of controllers is 0-based (the first controller has an index of 0).

addController Adds a controller to this IFlowComposer instance.controllerflashx.textLayout.container:ContainerControllerThe ContainerController object to add. Adds a controller to this IFlowComposer instance.

The container is added to the end of the container list.

composeToController Composes the content of the root element up to and including the container at the specified index.true if anything changed. indexunknowncompose at least up to this container in the TextFlow. If controllerIndex is greater than the number of controllers, compose to the end of the last container. Composes the content of the root element up to and including the container at the specified index.

If the contents of any container up to and including the container at the specified index has changed, the method returns true. If index is greater than the number of controllers (or not specified), then all containers are composed.

updateAllControllers()updateToController()
composeToPosition Composes the content of the root element up to the specified position.true if anything changed. absolutePositionunknowncompose at least up to this position in the TextFlow. By default or if absolutePosition is past the end of the flow compose to the end of the flow. Composes the content of the root element up to the specified position.

If the contents of any container up to and including the container holding the content at the specified position has changed, the method returns true. If absolutePosition is greater than the length of the TextFlow (or not specified), then the entire flow is composed.

updateAllControllers()updateToController()
compose Calculates how many lines are necessary to display the content in the root element of the flow and the positions of these lines in the flow's display containers.true if anything changed. Calculates how many lines are necessary to display the content in the root element of the flow and the positions of these lines in the flow's display containers.

Implementations of this method should not update the display, but should save the results so that subsequent calls to compose() or updateAllControllers() do not perform an additional recomposition if the flow content has not changed.

If the contents of any container have changed, the method must return true.

updateAllControllers()updateToController()
damage Mark lines as damaged and needing a recompose.startPositionbeginning of range to damage damageLengthnumber of characters to damage damageTypetype of damage. One of flashx.textLayout.compose.FlowDamageType Mark lines as damaged and needing a recompose. flashx.textLayout.compose.FlowDamageTypefindControllerIndexAtPosition Returns the index of the controller containing the content at the specified position.the index of the container controller or -1 if not found. absolutePositionThe position of the content for which the container index is sought. preferPreviousfalseSpecifies which container index to return when the position is between the last element in one container and the first element in the next. Returns the index of the controller containing the content at the specified position.

A position can be considered to be the division between two characters or other elements of a text flow. If the value in absolutePosition is a position between the last character of one container and the first character of the next, then the preceding container is returned if the preferPrevious parameter is set to true and the later container is returned if the preferPrevious parameter is set to false.

The method must return -1 if the content at the specified position is not in any container or is outside the range of positions in the text flow.

findLineAtPosition Returns the TextFlowLine object containing the content at the specified position.the TextFlowLine containing the content at the specified position, or null if not found. flashx.textLayout.compose:TextFlowLineabsolutePositionThe position of the content for which you want the TextFlowLine object. preferPreviousfalse Specifies which line to return when the position is between the last element of one line and the first element of the next. Returns the TextFlowLine object containing the content at the specified position.

A position can be considered to be the division between two characters or other elements of a text flow. If the value in absolutePosition is a position between the last element of one line and the first element of the next, then the preceding line is returned if the preferPrevious parameter is set to true and the later line is returned if the preferPrevious parameter is set to false.

findLineIndexAtPosition Returns the sequential line number of the TextFlowLine object that contains the content at the specified position.the index of the text line at the specified position. If not found, treats as past the end and returns the number of lines. absolutePositionThe position of the content for which you want the text line. preferPreviousfalseSpecifies which container index to return when the position is between the last line in one container and the first line in the next. Returns the sequential line number of the TextFlowLine object that contains the content at the specified position.

The number of the first line is 0 and the number of the last line is equal to the number of lines minus one. If the position specified in absolutePosition is past the end of the text flow, this method must return the number that will be assigned to the next new line added to the text flow (which is equal to the number of current lines).

A position can be considered to be the division between two characters or other elements of a text flow. If the value in absolutePosition is a position between the last line of one container and the first line of the next, then the preceding container is returned if the preferPrevious parameter is set to true and the later container is returned if the preferPrevious parameter is set to false.

getControllerAt Returns the ContainerController object at the specified index.the ContainerController object at the specified position. flashx.textLayout.container:ContainerControllerindexThe index of the ContainerController object to return. Returns the ContainerController object at the specified index. getControllerIndex Returns the index of the specified ContainerController object.the index of the specified ContainerController object or -1 if the controller is not attached to this flow composer. controllerflashx.textLayout.container:ContainerControllerA reference to the ContainerController object to find. Returns the index of the specified ContainerController object. getLineAt Returns the line with the specified line number.the TextFlowLine with the specified line number, or null, if not found. flashx.textLayout.compose:TextFlowLineindex The line number of the TextFlowLine object to return. Returns the line with the specified line number.

The list of lines is numbered from zero to the number of lines minus one. If the value in index is outside the bounds of the list of lines, then this function returns null.

interactionManagerChanged Called by the TextFlow when the interaction manager changes.newInteractionManagerflashx.textLayout.edit:ISelectionManagerThe new ISelectionManager instance. Called by the TextFlow when the interaction manager changes.

Implementations of IFlowComposer should update event listeners and properties that reference the interaction manager.

isDamaged Indicates whether any TextFlowLine objects between the beginning of the flow and the line containing the content at the specified position are marked as damaged.true if any of the TextFlowLine objects from the start of the flow up to the line containing the content at absolutePosition are marked as damaged. absolutePositionthe last position in the area of interest Indicates whether any TextFlowLine objects between the beginning of the flow and the line containing the content at the specified position are marked as damaged. removeAllControllers Removes all controllers from this IFlowComposer instance. Removes all controllers from this IFlowComposer instance. removeControllerAt Removes the controller at the specified index from this IFlowComposer instance.indexThe index of the ContainerController object to remove. Removes the controller at the specified index from this IFlowComposer instance. removeController Removes a controller from this IFlowComposer instance.controllerflashx.textLayout.container:ContainerControllerThe ContainerController instance to remove. Removes a controller from this IFlowComposer instance. setFocus Sets the focus to the container that contains the location specified by the absolutePosition parameter.absolutePositionSpecifies the position in the text flow of the container to receive focus. preferPreviousfalseIf true and the position is the before the first character in a container, sets focus to the end of the previous container. Sets the focus to the container that contains the location specified by the absolutePosition parameter.

It is the responsibility of the implementation to define what setting the focus means. For example, an implementation could use the built-in focus property of the Stage object (as long as the containers were InteractiveObjects) or the implementation could manage the focus some other way.

flash.display.Stage.focus
setRootElementnewRootElementflashx.textLayout.elements:ContainerFormattedElementupdateAllControllers Composes the content of the root element and updates the display.true if anything changed. Composes the content of the root element and updates the display.

Text layout is typically conducted in two phases: composition and display. In the composition phase, the flow composer calculates how many lines are necesary to display the content as well as the position of these lines in the flow's display containers. In the display phase, the flow composer updates the display object children of its containers. The updateAllControllers() method is expected to carry out both phases. An efficient implementation will keep track of changes to content so that a full cycle of composition and display is only performed when necessary.

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

If the contents of any container is changed, the method must return true.

updateLengths Update the lengths in the lines to maintain mapping to the TextFlow.startPositionbeginning of change in length deltaLengthchange in number of characters. Update the lengths in the lines to maintain mapping to the TextFlow. updateToController Composes and updates the display up to and including the container at the specified index.true if anything changed. indexunknownindex of the last container to update, by default will update all containers Composes and updates the display up to and including the container at the specified index.

The updateToController() method is expected to both compose the content and update the display so that all containers up to and including the container at the specified index are current. For example, if you have a chain of twenty containers and specify an index of 10, updateToController() must ensures that the first through the tenth (indexes 0-9) containers are composed and displayed. Composition can stop at that point. If controllerIndex is -1 (or not specified), then all containers should be updated.

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

If the contents of any container is changed, the method must return true.

composing True, if the flow composer is currently performing a composition operation. True, if the flow composer is currently performing a composition operation. damageAbsoluteStart The first invalid position in the root element, as an absolute position from the start of the flow. The first invalid position in the root element, as an absolute position from the start of the flow. numControllers The number of containers assigned to this IFlowComposer instance. The number of containers assigned to this IFlowComposer instance. numLines The total number of lines composed in the flow. 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. rootElement The root element associated with this IFlowComposer instance.flashx.textLayout.elements:ContainerFormattedElement The root element associated with this IFlowComposer instance.

Only a TextFlow object can be a root element.

ContainerFormattedElement
swfContext The ISWFContext instance to be used for calls that must be made in a specific SWF context Implementations of IFlowComposer should allow this property to be set so that users of the interface can create lines in a different SWF context than the one containing the implementation.flashx.textLayout.compose:ISWFContext The ISWFContext instance to be used for calls that must be made in a specific SWF context

Implementations of IFlowComposer should allow this property to be set so that users of the interface can create lines in a different SWF context than the one containing the implementation. A default implementation of ISWFContext should also be supplied.

ISWFContext
ISWFContext The ISWFContext interface allows a SWF file to share its context with other SWF files that load it. The ISWFContext interface allows a SWF file to share its context with other SWF files that load it. An application that loads a SWF file of type ISWFContext can call methods in the context of the loaded SWF file. The main usage is for calling the FTE TextLine creation methods.

There are two reasons for an application to use this interface to control TextLine creation:

  • Reuse an embedded font: if an application wants to use a font embedded in a loaded SWF file, the application can access the font if a TextLine is created in the context of the loaded SWF file.
  • Reuse existing TextLine instances: reusing existing TextLine instances can result in faster recompose times. TLF reuses existing TextLine instances internally. TLF reuses a TextLine by calling TextBlock.recreateTextLine() instead of TextBlock.createTextLine() when TLF recognizes that a TextLine is extant.

Your application may have additional TextLine instances that can be reused. To manually reuse existing TextLine instances:

  1. trap calls to TextBlock.createTextLine(), then
  2. call TextBlock.recreateTextLine() with the extant TextLine instance instead of TextBlock.createTextLine().

Please note, however, that the TextBlock.recreateTextLine() is available only in Flash Player 10.1 and later.

flash.text.engine.TextBlock.createTextLine()flash.text.engine.TextBlock.recreateTextLine()callInContext A way to call a method in a client controlled context.Whatever the function returns, if anything. fnThe function or method to call thisArgThe this pointer for the function argArrayThe arguments for the function returnstrueIf true, the function returns a value A way to call a method in a client controlled context. Function.apply()
IVerticalJustificationLine The IVerticalJustificationLine interface defines the methods and properties required to allow the vertical justification of text lines. The IVerticalJustificationLine interface defines the methods and properties required to allow the vertical justification of text lines. ascent descent height The height of the line in pixels. The height of the line in pixels. x The horizontal position of the line relative to its container, expressed as the offset in pixels from the left of the container. The horizontal position of the line relative to its container, expressed as the offset in pixels from the left of the container. yy The vertical position of the line relative to its container, expressed as the offset in pixels from the top of the container. The vertical position of the line relative to its container, expressed as the offset in pixels from the top of the container. x