Apache Flex 4.16.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
TextFlowTextLineFactory

Package | flashx.textLayout.factory
Class | public class TextFlowTextLineFactory
Inheritance | TextFlowTextLineFactory TextLineFactoryBase Object

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The TextFlowTextLineFactory class provides a simple way to create TextLines for displaying text from a text flow.

The text lines are static and created fit in a single bounding rectangle, but can have multiple paragraphs and formats as well as inline graphics. To create TextLine objects directly from a string, use StringTextLineFactory.

Note: When using inline graphics, the `source` property of the InlineGraphicElement object must either be an instance of a DisplayObject or a Class object representing an embedded asset. URLRequest objects cannot be used. The width and height of the inline graphic at the time the line is created is used to compose the flow.

See also

TextFlow
StringTextLineFactory

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | compositionBounds : Rectangle The rectangle within which text lines are created. | TextLineFactoryBase
|  | horizontalScrollPolicy : String Specifies how lines are created when the composition bounds are not large enough. | TextLineFactoryBase
|  | isTruncated : Boolean [read-only] Indicates whether text was truncated when lines were last created. | TextLineFactoryBase
|  | swfContext : ISWFContext The ISWFContext instance used to make FTE calls as needed. | TextLineFactoryBase
|  | truncationOptions : TruncationOptions Specifies the options for truncating the text if it doesn't fit in the composition bounds. | TextLineFactoryBase
|  | verticalScrollPolicy : String Specifies how lines are created when the composition bounds are not large enough. | TextLineFactoryBase

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | TextFlowTextLineFactory() Creates a TextFlowTextLineFactory object. | TextFlowTextLineFactory
|  | createTextLines(callback:Function, textFlow:TextFlow):void Creates TextLine objects from the specified text flow. | TextFlowTextLineFactory
|  | getContentBounds():Rectangle The smallest rectangle in which the layed-out content fits. | TextLineFactoryBase

Constructor Detail

TextFlowTextLineFactory | () | Constructor

`public function TextFlowTextLineFactory()`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Creates a TextFlowTextLineFactory object.

Method Detail

createTextLines | () | method

`public function createTextLines(callback:Function, textFlow:TextFlow):void`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Creates TextLine objects from the specified text flow.

The text lines are composed to fit the bounds assigned to the `compositionBounds` property. As each line is created, the factory calls the function specified in the `callback` parameter. This function is passed the TextLine object and is responsible for displaying the line. If a line has a background color, the factory also calls the callback function with a Shape object containing a rectangle of the background color.

Note that the scroll policies of the factory will control how many lines are generated.

Parameters

| `callback:Function` — function to call with each generated TextLine object. The callback will be called with a Shape object representing any background color (if present), and with TextLine objects for the text.
| `textFlow:TextFlow` — The TextFlow from which the lines are created.

Sun Mar 5 2017, 03:42 PM +11:00