flashx.textLayout.operations

# CompositeOperation - AS3

Package | flashx.textLayout.operations
Class | public class CompositeOperation
Inheritance | CompositeOperation FlowOperation Object

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

The CompositeOperation class encapsulates a group of transformations managed as a unit.

The CompositeOperation class provides a grouping mechanism for combining multiple FlowOperations into a single atomic operation. Grouping operations allows them to be undone and redone as a unit. For example, several single character inserts followed by several backspaces can be undone together as if they were a single operation. Grouping also provides a mechanism for representing complex operations. For example, a replace operation that modifies more than one text ranges can be represented and managed as a single composite operation.

Note: It can be more efficient to merge individual atomic operations rather than to combine separate operations into a group. For example, several sequential character inserts can easily be represented as a single insert operation, and undoing or redoing that single operation is more efficient than undoing or redoing a group of insert operations.

Related API Elements

flashx.textLayout.edit.EditManager
flashx.textLayout.events.FlowOperationEvent

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | beginGeneration : uint [read-only] The text flow generation before the operation. | FlowOperation
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | endGeneration : uint [read-only] The text flow generation after the operation. | FlowOperation
|  | operations : Array An array containing the operations grouped by this composite operation. | CompositeOperation
|  | textFlow : flashx.textLayout.elements:TextFlow The TextFlow object to which this operation is applied. | FlowOperation
|  | userData : * Arbitrary data associated with an element. | FlowOperation

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | CompositeOperation(operations:Array = null) Creates a CompositeOperation object. | CompositeOperation
|  | addOperation(operation:FlowOperation):void Adds an additional operation to the end of the list. | CompositeOperation
|  | canUndo():Boolean Test if this operation be placed on the undo stack. | FlowOperation
|  | doOperation():Boolean Executes the operation. | FlowOperation
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | redo():SelectionState Re-executes the operation. | FlowOperation
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | undo():SelectionState Reverses the operation. | FlowOperation
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### operations

property

`operations:Array`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

An array containing the operations grouped by this composite operation.

Implementation
`public function get operations():Array`
`public function set operations(value:Array):void`
Constructor Detail

### CompositeOperation

()
Constructor

`public function CompositeOperation(operations:Array = null)`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Creates a CompositeOperation object.

Parameters

| `operations:Array` (default = `null`)`` — The operations to group.

Method Detail

### addOperation

()
method

`public function addOperation(operation:FlowOperation):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5

Adds an additional operation to the end of the list.

The new operation must operate on the same TextFlow object as the other operations in the list.

Parameters

| `operation:FlowOperation`

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00