ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
flashx.textLayout.compose 

FlowComposerBase  - AS3

Packageflashx.textLayout.compose
Classpublic class FlowComposerBase
InheritanceFlowComposerBase Inheritance Object
Subclasses StandardFlowComposer

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

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).

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  damageAbsoluteStart : int
[read-only] The absolute position immediately preceding the first element in the text flow that requires composition and updating.
FlowComposerBase
  numLines : int
[read-only] The total number of lines composed in the flow.
FlowComposerBase
  swfContext : ISWFContext
The ISWFContext instance used to make FTE calls as needed.
FlowComposerBase
  textFlow : flashx.textLayout.elements:TextFlow
[read-only] The TextFlow object to which this flow composer is attached.
FlowComposerBase
Public Methods
 MethodDefined By
  
Constructor.
FlowComposerBase
  
damage(startPosition:int, damageLength:int, damageType:String):void
Mark lines as damaged and needing a recompose.
FlowComposerBase
  
findLineAtPosition(absolutePosition:int, preferPrevious:Boolean = false):flashx.textLayout.compose:TextFlowLine
Returns the TextFlowLine object containing the content at the specified position.
FlowComposerBase
  
findLineIndexAtPosition(absolutePosition:int, preferPrevious:Boolean = false):int
Returns the sequential line number of the TextFlowLine object that contains the content at the specified position.
FlowComposerBase
  
Returns the line with the specified line number.
FlowComposerBase
 Inherited
Indicates whether an object has a specified property defined.
Object
  
isDamaged(absolutePosition:int):Boolean
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.
FlowComposerBase
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
updateLengths(startPosition:int, deltaLength:int):void
Update the lengths in the lines to maintain mapping to the TextFlow.
FlowComposerBase
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

damageAbsoluteStart

property
damageAbsoluteStart:int  [read-only]

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

The absolute position immediately preceding the first element in the text flow that requires composition and updating.



Implementation
    public function get damageAbsoluteStart():int

numLines

property 
numLines:int  [read-only]

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

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

swfContext

property 
swfContext:ISWFContext

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

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.



Implementation
    public function get swfContext():ISWFContext
    public function set swfContext(value:ISWFContext):void

Related API Elements

textFlow

property 
textFlow:flashx.textLayout.elements:TextFlow  [read-only]

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

The TextFlow object to which this flow composer is attached.



Implementation
    public function get textFlow():flashx.textLayout.elements:TextFlow

Related API Elements

Constructor Detail

FlowComposerBase

()Constructor
public function FlowComposerBase()

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

Constructor.

Method Detail

damage

()method
public function damage(startPosition:int, damageLength:int, damageType:String):void

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

Mark lines as damaged and needing a recompose.

Parameters

startPosition:int — beginning of range to damage
 
damageLength:int — number of characters to damage
 
damageType:String — type of damage. One of flashx.textLayout.compose.FlowDamageType

findLineAtPosition

()method 
public function findLineAtPosition(absolutePosition:int, preferPrevious:Boolean = false):flashx.textLayout.compose:TextFlowLine

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

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.

Parameters

absolutePosition:int — The position of the content for which you want the TextFlowLine object.
 
preferPrevious:Boolean (default = false) — Specifies which line to return when the position is between the last element of one line and the first element of the next.

Returns
flashx.textLayout.compose:TextFlowLine — the TextFlowLine containing the content 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 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.

Parameters

absolutePosition:int — The position of the content for which you want the text line.
 
preferPrevious:Boolean (default = false) — Specifies which container index to return when the position is between the last line in one container and the first line in the next.

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.

getLineAt

()method 
public function getLineAt(index:int):flashx.textLayout.compose:TextFlowLine

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

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.

Parameters

index:int — The line number of the TextFlowLine object to return.

Returns
flashx.textLayout.compose:TextFlowLine — the TextFlowLine with the specified line number, or null, if not found.

isDamaged

()method 
public function isDamaged(absolutePosition:int):Boolean

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

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.

Parameters

absolutePosition:int — the last position in the area of interest

Returns
Boolean — 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.

updateLengths

()method 
public function updateLengths(startPosition:int, deltaLength:int):void

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

Update the lengths in the lines to maintain mapping to the TextFlow.

Parameters

startPosition:int — beginning of change in length
 
deltaLength:int — change in number of characters.