Package | flashx.textLayout.operations |
Class | public class ClearFormatOperation |
Inheritance | ClearFormatOperation FlowTextOperation FlowOperation Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
An UndefineFormatOperation undefines properties set in the leaf format to the text in the specified range (no change is made if the specified range is a single point). It undefines properties set in the paragraph format to any paragraphs at least partially within the range (or a single paragraph if the range is a single point). And it undefines properties set in the container format to any containers at least partially within the range (or a single container if the range is a single point).
Related API Elements
Property | Defined By | ||
---|---|---|---|
absoluteEnd : int
The absolute end point of the range of text to which this operation is applied. | FlowTextOperation | ||
absoluteStart : int
The absolute start point of the range of text to which this operation is applied. | FlowTextOperation | ||
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 | ||
containerFormat : flashx.textLayout.formats:ITextLayoutFormat
The format properties to undefine on the containers in the range. | ClearFormatOperation | ||
endGeneration : uint [read-only]
The text flow generation after the operation. | FlowOperation | ||
leafFormat : flashx.textLayout.formats:ITextLayoutFormat
The format properties to undefine on the leaf elements in the range. | ClearFormatOperation | ||
originalSelectionState : SelectionState
The selection state at the start of the operation. | FlowTextOperation | ||
paragraphFormat : flashx.textLayout.formats:ITextLayoutFormat
The format properties to undefine on the paragraphs in the range. | ClearFormatOperation | ||
prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | ||
textFlow : flashx.textLayout.elements:TextFlow
The TextFlow object to which this operation is applied. | FlowOperation | ||
userData : *
Arbitrary data associated with an element. | FlowOperation |
Method | Defined By | ||
---|---|---|---|
ClearFormatOperation(operationState:SelectionState, leafFormat:flashx.textLayout.formats:ITextLayoutFormat, paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, containerFormat:flashx.textLayout.formats:ITextLayoutFormat = null)
Creates an ClearFormatOperation object. | ClearFormatOperation | ||
Test if this operation be placed on the undo stack. | FlowOperation | ||
Executes the operation. | FlowOperation | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
[override] | ClearFormatOperation | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Reverses the operation. | FlowOperation | ||
Returns the primitive value of the specified object. | Object |
containerFormat | property |
containerFormat:flashx.textLayout.formats:ITextLayoutFormat
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The format properties to undefine on the containers in the range.
The formats of any containers at least partially within the range are updated.
If the range of this operation is a point, then a single container is updated.
If containerFormat
is null
, then no container formats are changed.
Implementation
public function get containerFormat():flashx.textLayout.formats:ITextLayoutFormat
public function set containerFormat(value:flashx.textLayout.formats:ITextLayoutFormat):void
leafFormat | property |
leafFormat:flashx.textLayout.formats:ITextLayoutFormat
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The format properties to undefine on the leaf elements in the range.
If the range of this operation is a point, or if leafFormat
is null
,
then no leaf element formats are changed.
Implementation
public function get leafFormat():flashx.textLayout.formats:ITextLayoutFormat
public function set leafFormat(value:flashx.textLayout.formats:ITextLayoutFormat):void
paragraphFormat | property |
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The format properties to undefine on the paragraphs in the range.
The formats of any paragraphs at least partially within the range are updated.
If the range of this operation is a point, then a single paragraph is updated.
If paragraphFormat
is null
, then no paragraph formats are changed.
Implementation
public function get paragraphFormat():flashx.textLayout.formats:ITextLayoutFormat
public function set paragraphFormat(value:flashx.textLayout.formats:ITextLayoutFormat):void
ClearFormatOperation | () | Constructor |
public function ClearFormatOperation(operationState:SelectionState, leafFormat:flashx.textLayout.formats:ITextLayoutFormat, paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, containerFormat:flashx.textLayout.formats:ITextLayoutFormat = null)
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Creates an ClearFormatOperation object.
ParametersoperationState:SelectionState — Defines the text range to which the format is applied.
| |
leafFormat:flashx.textLayout.formats:ITextLayoutFormat — The format whose set values indicate properties to undefine to LeafFlowElement objects in the selected range.
| |
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — The format whose set values indicate properties to undefine to ParagraphElement objects in the selected range.
| |
containerFormat:flashx.textLayout.formats:ITextLayoutFormat (default = null ) — The format whose set values indicate properties to undefine to ContainerController objects in the selected range.
|
redo | () | method |
This code snippet shows a use of the ApplyFormatOperation
class.
After an operation of this type is executed, the font size of the new TextLayoutFormat is
gathered, which can be used to update a display label or menu.
package flashx.textLayout.operations.examples { import flashx.textLayout.elements.TextFlow; import flashx.textLayout.events.FlowOperationEvent; import flashx.textLayout.operations.ApplyFormatOperation; public class ApplyFormatOperation_example { public function attach(textFlow:TextFlow):void { textFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN, opEndHandler); } public function opEndHandler(evt:FlowOperationEvent):void { var flowOp:ApplyFormatOperation = evt.operation as ApplyFormatOperation; if (flowOp is ApplyFormatOperation && flowOp.leafFormat != null && evt.cancelable) { //determine the font size - can be used to update a menu or label var fSize:int = flowOp.leafFormat.fontSize; if (fSize > 18) evt.preventDefault(); } } } }
Mon Nov 28 2011, 06:48 AM -08:00