| 包 | flashx.textLayout.operations | 
| 类 | public class ApplyLinkOperation | 
| 继承 | ApplyLinkOperation    FlowTextOperation   FlowOperation   Object | 
| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
相关 API 元素
flashx.textLayout.elements.LinkElement
flashx.textLayout.edit.EditManager
flashx.textLayout.events.FlowOperationEvent
flashx.textLayout.edit.EditManager
flashx.textLayout.events.FlowOperationEvent
公共属性
| 属性 | 由以下参数定义 | ||
|---|---|---|---|
![]()  | absoluteEnd : int  
		 要应用该操作的文本范围的结束点绝对值。  | FlowTextOperation | |
![]()  | absoluteStart : int  
		 要应用该操作的文本范围的起始点绝对值。  | FlowTextOperation | |
![]()  | beginGeneration : uint [只读] 
		 操作之前生成文本流。  | FlowOperation | |
![]()  | constructor : Object 
	 对类对象或给定对象实例的构造函数的引用。  | Object | |
![]()  | endGeneration : uint [只读]  
		 操作之后生成文本流。  | FlowOperation | |
| extendToLinkBoundary : Boolean 
		 是否扩展所选项目以包含由所选项目覆盖的任何现有链接的完整文本,然后应用更改。  | ApplyLinkOperation | ||
| href : String  
		 要与链接关联的 URI。  | ApplyLinkOperation | ||
| newLinkElement : LinkElement [只读]  
		 由 doOperation 创建的 LinkElement。  | ApplyLinkOperation | ||
![]()  | originalSelectionState : SelectionState  
		 操作开始时的选择状态。  | FlowTextOperation | |
| target : String 
		 链接的目标。  | ApplyLinkOperation | ||
![]()  | textFlow : flashx.textLayout.elements:TextFlow  
		 要应用该操作的 TextFlow 对象。  | FlowOperation | |
![]()  | userData : *  
		 与元素关联的任意数据。  | FlowOperation | |
公共方法 
| 方法 | 由以下参数定义 | ||
|---|---|---|---|
ApplyLinkOperation(operationState:SelectionState, href:String, target:String, extendToLinkBoundary:Boolean)  
		 创建 ApplyLinkOperation 对象。  | ApplyLinkOperation | ||
![]()  | 	
		 测试此操作是否被放置在撤消堆栈上。  | FlowOperation | |
![]()  |  
		 执行操作。  | FlowOperation | |
![]()  | 
	 表示对象是否已经定义了指定的属性。  | Object | |
![]()  | 
	 表示 Object 类的实例是否在指定为参数的对象的原型链中。  | Object | |
![]()  | 
	 表示指定的属性是否存在、是否可枚举。  | Object | |
![]()  | [覆盖] 	
		 	
		 重新执行操作。  | FlowTextOperation | |
![]()  | 
     设置循环操作动态属性的可用性。  | Object | |
![]()  | 
	 返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。  | Object | |
![]()  | 
	 返回指定对象的字符串表示形式。  | Object | |
![]()  | 	
		 取消操作。  | FlowOperation | |
![]()  | 
	 返回指定对象的原始值。  | Object | |
属性详细信息
extendToLinkBoundary | 属性 | 
href | 属性 | 
newLinkElement | 属性 | 
newLinkElement:LinkElement  [只读] | 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 2.0 | 
由 doOperation 创建的 LinkElement。
实现
    public function get newLinkElement():LinkElementtarget | 属性 | 
构造函数详细信息
ApplyLinkOperation | () | 构造函数 | 
public function ApplyLinkOperation(operationState:SelectionState, href:String, target:String, extendToLinkBoundary:Boolean)| 语言版本: | ActionScript 3.0 | 
| 运行时版本: | Flash Player 10, AIR 1.5 | 
创建 ApplyLinkOperation 对象。
参数operationState:SelectionState — 要应用该操作的文本范围。
		  | |
href:String — 要与链接关联的 URI。如果 href 为空字符串,则删除选择内容中的链接的 URI。
		  | |
target:String — 链接的目标。
		  | |
extendToLinkBoundary:Boolean — 是否扩展所选项目以包含由所选项目覆盖的任何现有链接的完整文本,然后应用更改。
		 
		  | 
示例 如何使用本示例 
ApplyLinkOperation_example.as
以下代码片段显示 ApplyLinkOperation 类的应用。执行该类型的操作之前,验证应用于该 TextFlow 的链接。如果链接无效,则取消该事件,并且不应用该链接。
package flashx.textLayout.operations.examples
{
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.events.FlowOperationEvent;
    import flashx.textLayout.operations.FlowOperation;
    import flashx.textLayout.operations.ApplyLinkOperation;
    
    public class ApplyLinkOperation_example
    {
        public function attach(textFlow:TextFlow):void
        {
            textFlow.addEventListener(FlowOperationEvent.FLOW_OPERATION_BEGIN, opBeginHandler);
        }
            
        public function opBeginHandler(evt:FlowOperationEvent):void { 
            var flowOp:FlowOperation = evt.operation; 
            if(flowOp is ApplyLinkOperation && evt.cancelable) {
                //if link is invalid, cancel link operation
                if(!linkValid(flowOp.textFlow)) {
                    evt.preventDefault();
                }
            }
        }
        private function linkValid(tf:TextFlow):Boolean { 
            //code to check inserted link text in this TextFlow for validity
            return false;
        }
    }
}
Tue Jun 12 2018, 11:04 AM Z
 
 隐藏继承的公共属性
 显示继承的公共属性