Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
CompositionCompleteEvent

Package | flashx.textLayout.events
Class | public class CompositionCompleteEvent
Inheritance | CompositionCompleteEvent flash.events.Event

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

A TextFlow instance dispatches this event after a compose operation completes. Each text container has two states: composition and display. This event notifies you when the composition phase has ended. This provides an opportunity to make any necessary and appropriate changes to the container before you display the text. For example, you can use this event to add highlighting of certain words or characters in the text flow before the text is displayed.

The three main methods that dispatch this event are `compose()`, `updateToController()`, and `updateAllControllers()`. All three of these methods are in the StandardFlowComposer class.

Note: If the event is dispatched by the `updateAllControllers()` method, do not call `updateAllControllers()` again in your event handler function. Such a call would be a recursive call because the `updateAllControllers()` method executes both the composition and display steps. The `updateAllControllers()` dispatches this event after composition completes, but before the display step executes. The same reasoning applies to the `updateToController()` method.

See also

flashx.textLayout.elements.TextFlow

Public Properties

| Property | Defined By
--- | --- | ---
|  | compositionLength : int The number of characters composed. | CompositionCompleteEvent
|  | compositionStart : int The start location of the text range affected by the composition, expressed as an index into the text flow. | CompositionCompleteEvent
|  | textFlow : TextFlow TextFlow on which composition has been completed. | CompositionCompleteEvent

Public Methods

| Method | Defined By
--- | --- | ---
|  | CompositionCompleteEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, textFlow:TextFlow = null, compositionStart:int = 0, compositionLength:int = 0) Constructor | CompositionCompleteEvent

Public Constants

| Constant | Defined By
--- | --- | ---
|  | COMPOSITION_COMPLETE : String = compositionComplete [static] Defines the value of the type property of a compositionComplete event object | CompositionCompleteEvent

Property Detail

compositionLength | property

`compositionLength:int`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The number of characters composed.

Implementation
`public function get compositionLength():int`
`public function set compositionLength(value:int):void`

compositionStart | property |

`compositionStart:int`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The start location of the text range affected by the composition, expressed as an index into the text flow.

Implementation
`public function get compositionStart():int`
`public function set compositionStart(value:int):void`

textFlow | property |

`textFlow:TextFlow`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

TextFlow on which composition has been completed.

Implementation
`public function get textFlow():TextFlow`
`public function set textFlow(value:TextFlow):void`
Constructor Detail

CompositionCompleteEvent | () | Constructor

`public function CompositionCompleteEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, textFlow:TextFlow = null, compositionStart:int = 0, compositionLength:int = 0)`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Constructor

Parameters

| `type:String` — event type - use the static property COMPOSITION_COMPLETE.
| `bubbles:Boolean` (default = `false`)`` — Indicates whether an event is a bubbling event. This event does not bubble.
| `cancelable:Boolean` (default = `false`)`` — Indicates whether the behavior associated with the event can be prevented. This event cannot be cancelled.
| `textFlow:TextFlow` (default = `null`)`` — The TextFlow which was composed
| `compositionStart:int` (default = `0`)`` — start of composition, in terms of an index into the text flow.
| `compositionLength:int` (default = `0`)`` — length number of characters composed

Constant Detail

COMPOSITION_COMPLETE | Constant

`public static const COMPOSITION_COMPLETE:String = compositionComplete`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `compositionComplete` event object

Wed Nov 15 2017, 09:50 AM +01:00