| 包 | flashx.textLayout.operations | 
| 类 | public class ClearFormatOperation | 
| 继承 | ClearFormatOperation    FlowTextOperation   FlowOperation   Object | 
| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
UndefineFormatOperation 针对指定范围的文本对在叶格式中设置的属性取消定义(如果指定的范围为单个点,不会进行任何更改)。它针对至少部分在该范围内的段落对在段落格式中设置的属性取消定义(如果范围为单个点,则对单个段落取消定义)。它针对至少部分在该范围内的容器对在容器格式中设置的属性取消定义(如果范围为单个点,则对单个容器取消定义)。
相关 API 元素
公共属性
| 属性 | 由以下参数定义 | ||
|---|---|---|---|
![]()  | absoluteEnd : int  
		 要应用该操作的文本范围的结束点绝对值。  | FlowTextOperation | |
![]()  | absoluteStart : int  
		 要应用该操作的文本范围的起始点绝对值。  | FlowTextOperation | |
![]()  | beginGeneration : uint [只读] 
		 操作之前生成文本流。  | FlowOperation | |
![]()  | constructor : Object 
	 对类对象或给定对象实例的构造函数的引用。  | Object | |
| containerFormat : flashx.textLayout.formats:ITextLayoutFormat  
		 要在范围内的容器上取消定义的格式属性。  | ClearFormatOperation | ||
![]()  | endGeneration : uint [只读]  
		 操作之后生成文本流。  | FlowOperation | |
| leafFormat : flashx.textLayout.formats:ITextLayoutFormat  
		 要在范围内的叶元素上取消定义的格式属性。  | ClearFormatOperation | ||
![]()  | originalSelectionState : SelectionState  
		 操作开始时的选择状态。  | FlowTextOperation | |
| paragraphFormat : flashx.textLayout.formats:ITextLayoutFormat  
		 要在范围内的段落上取消定义的格式属性。  | ClearFormatOperation | ||
![]()  | textFlow : flashx.textLayout.elements:TextFlow  
		 要应用该操作的 TextFlow 对象。  | FlowOperation | |
![]()  | userData : *  
		 与元素关联的任意数据。  | FlowOperation | |
公共方法 
| 方法 | 由以下参数定义 | ||
|---|---|---|---|
ClearFormatOperation(operationState:SelectionState, leafFormat:flashx.textLayout.formats:ITextLayoutFormat, paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, containerFormat:flashx.textLayout.formats:ITextLayoutFormat = null)  
		 创建 ClearFormatOperation 对象。  | ClearFormatOperation | ||
![]()  | 	
		 测试此操作是否被放置在撤消堆栈上。  | FlowOperation | |
![]()  |  
		 执行操作。  | FlowOperation | |
![]()  | 
	 表示对象是否已经定义了指定的属性。  | Object | |
![]()  | 
	 表示 Object 类的实例是否在指定为参数的对象的原型链中。  | Object | |
![]()  | 
	 表示指定的属性是否存在、是否可枚举。  | Object | |
[覆盖]   | ClearFormatOperation | ||
![]()  | 
     设置循环操作动态属性的可用性。  | Object | |
![]()  | 
	 返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。  | Object | |
![]()  | 
	 返回指定对象的字符串表示形式。  | Object | |
![]()  | 	
		 取消操作。  | FlowOperation | |
![]()  | 
	 返回指定对象的原始值。  | Object | |
属性详细信息
containerFormat | 属性 | 
containerFormat:flashx.textLayout.formats:ITextLayoutFormat| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
要在范围内的容器上取消定义的格式属性。
更新至少部分在该范围内的容器的格式。如果该操作的范围为一个点,则更新单个容器。如果 containerFormat 为 null,则不更改任何容器格式。
实现
    public function get containerFormat():flashx.textLayout.formats:ITextLayoutFormat    public function set containerFormat(value:flashx.textLayout.formats:ITextLayoutFormat):voidleafFormat | 属性 | 
leafFormat:flashx.textLayout.formats:ITextLayoutFormat| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
要在范围内的叶元素上取消定义的格式属性。
如果该操作的范围为一个点,或者 leafFormat 为 null,则不会更改任何叶元素格式。
实现
    public function get leafFormat():flashx.textLayout.formats:ITextLayoutFormat    public function set leafFormat(value:flashx.textLayout.formats:ITextLayoutFormat):voidparagraphFormat | 属性 | 
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
要在范围内的段落上取消定义的格式属性。
更新至少部分在该范围内的段落的格式。如果该操作的范围为一个点,则更新单个段落。如果 paragraphFormat 为 null,则不更改任何段落格式。
实现
    public function get paragraphFormat():flashx.textLayout.formats:ITextLayoutFormat    public function set paragraphFormat(value:flashx.textLayout.formats:ITextLayoutFormat):void构造函数详细信息
ClearFormatOperation | () | 构造函数 | 
public function ClearFormatOperation(operationState:SelectionState, leafFormat:flashx.textLayout.formats:ITextLayoutFormat, paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, containerFormat:flashx.textLayout.formats:ITextLayoutFormat = null)| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
创建 ClearFormatOperation 对象。
参数operationState:SelectionState — 定义要应用格式的文本范围。
		   | |
leafFormat:flashx.textLayout.formats:ITextLayoutFormat —  一种格式,其设置值指示用于取消定义选定范围中 LeafFlowElement 对象的属性。
		   | |
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — 其设置的值指示对所选范围内的 ParagraphElement 对象取消定义的属性的格式。
		   | |
containerFormat:flashx.textLayout.formats:ITextLayoutFormat (default = null) — 其设置的值指示对所选范围内的 ContainerController 对象取消定义的属性的格式。
		 
		  | 
方法详细信息
redo | () | 方法 | 
示例 如何使用本示例 
ApplyFormatOperation_example.as
以下代码片段显示 ApplyFormatOperation 类的应用。执行该类型的操作后,将收集新 TextLayoutFormat 的字体大小,然后可将其用于更新显示标签或菜单。 
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();
            }
        }
    }
        
}
Tue Jun 12 2018, 11:04 AM Z
 
 隐藏继承的公共属性
 显示继承的公共属性