textLayout在快速输入清除时报错解决方法
var tf:TextFlow;
var len:int = tf.numChildren;
for (var i:int = 0; i < len; i += 1)
{
tf.removeChildAt(0);
}
tf.flowComposer.composeToPosition();
tf.flowComposer.updateAllControllers();
TypeError: Error #1009: 无法访问空对象引用的属性或方法。
at flashx.textLayout.edit::ParaEdit$/insertText() flashx\textLayout\edit\ParaEdit.as:54]
at flashx.textLayout.operations::InsertTextOperation/doInternal() flashx\textLayout\operations\InsertTextOperation.as:196]
at flashx.textLayout.operations::InsertTextOperation/doOperation() flashx\textLayout\operations\InsertTextOperation.as:223]
at flashx.textLayout.edit::EditManager/doInternal() flashx\textLayout\edit\EditManager.as:723]
at flashx.textLayout.edit::EditManager/doOperation() flashx\textLayout\edit\EditManager.as:603]
at flashx.textLayout.edit::EditManager/flushPendingOperations() flashx\textLayout\edit\EditManager.as:873]
at flashx.textLayout.compose::StandardFlowComposer/updateToController() flashx\textLayout\compose\StandardFlowComposer.as:554]
at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers() flashx\textLayout\compose\StandardFlowComposer.as:517]
tf.interactionManager.selectRange(tf.textLength, tf.textLength);
TypeError: Error #1009: 无法访问空对象引用的属性或方法。
at flashx.textLayout.edit::ParaEdit$/insertText() flashx\textLayout\edit\ParaEdit.as:54]
at flashx.textLayout.operations::InsertTextOperation/doInternal() flashx\textLayout\operations\InsertTextOperation.as:196]
at flashx.textLayout.operations::InsertTextOperation/doOperation() flashx\textLayout\operations\InsertTextOperation.as:223]
at flashx.textLayout.edit::EditManager/doInternal() flashx\textLayout\edit\EditManager.as:723]
at flashx.textLayout.edit::EditManager/doOperation() flashx\textLayout\edit\EditManager.as:603]
at flashx.textLayout.edit::EditManager/flushPendingOperations() flashx\textLayout\edit\EditManager.as:873]
at flashx.textLayout.compose::StandardFlowComposer/internalCompose() flashx\textLayout\compose\StandardFlowComposer.as:711]
at flashx.textLayout.compose::StandardFlowComposer/composeToPosition() flashx\textLayout\compose\StandardFlowComposer.as:837]
报错在ParaEdit.as,sibling为null
var sibling:FlowElement = textFlow.findLeaf(absoluteStart);
var siblingIndex:int;
var paragraph:ParagraphElement = sibling.getParagraph();
问题貌似是因为EditManager.as里insertText方法中的Event.ENTER_FRAME,这个下一帧处理好像会导致快速输入删除时候的不同步
if (captureLevel == 0 && origOperationState == null && controller && controller.container && allowDelayedOperations)
{
enterFrameListener = controller.container;
enterFrameListener.addEventListener(Event.ENTER_FRAME, enterFrameHandler, false, 1.0, true);
}
else
flushPendingOperations();
我的解决方法是同步处理 不让他下一帧处理 设置 EditManager(tf.interactionManager).allowDelayedOperations = false;
问题解决 具体为什么 还不是很清楚,先这么用着吧,如果有大神知道,希望可以交流
textLayout在快速输入清除时报错解决方法的更多相关文章
- mysql truncate带有被引用外键的表时报错解决方法
清空具有外键约束的表时报ERROR 1701(42000)的解决 mysql> truncate table t_users;ERROR 1701 (42000): Cannot trunc ...
- rebuild online时意外中断 再次重建时报错解决方法
rebuild online时意外中断 再次重建时报错 SQL> alter index PARTY.IDX_CM_INDIV_CUSTOMER_4 rebuild online; alter ...
- 安装redis 执行make命令时报错解决方法
一.未安装GCC 解决方法:执行yum install gcc-c++命令安装GCC,完成后再次执行make命令 yum install gcc-c++ Linux无法连接网络 http://www. ...
- XML节点名称中有小数点处理(deal with dot)导致使用xpath时报错解决方法
<?xml version="1.0"?> <ModifyFiles> <_Layout.cshtml>123456</_Layout.c ...
- python运用中文注释时报错解决方法
写了一段简单的代码,不知 为什么总是报错,后来上网查了一下才知道原因,当用中文进行注释时需要添加如下代码:# coding=utf-8 (注意:该段代码必须放在最前面才能有用,并且 ...
- react创建项目后运行npm run eject命令将配置文件暴露出来时报错解决方法
最近在用create-react-app创建项目,因要配置各种组件,比如babel,antd等, 需要运行npm run eject命令把项目的配置文件暴露出来,但是还是一如既然碰到报错,因为是在本地 ...
- 解决loadrunner在脚本回放时长时间等待及在vugen中create controller scenario时报错的方法!超管用!!
解决loadrunner在脚本回放时长时间等待及在vugen中create controller scenario时报错的方法 经过咨询,有两种方法.经过实践,下面的方法1有效,方法2无效(我下载安装 ...
- asp.net MVC webservice 报次错解决方法
asp.net MVC webservice 报次错解决方法: 解决方法: 在 RouteConfig.cs public static void RegisterRoutes(RouteCol ...
- redhat linux enterprise 5 输入ifconfig无效的解决方法
redhat linux enterprise 5 输入ifconfig无效的解决方法 在安装完成linux后,进入终端,输入命令行ifconfig,会提示bash: ifconfig: comm ...
随机推荐
- HDU 3635 并查集+路径压缩+记录每个点移动次数
题意: 给定n个点 oper个操作 每个点有1个龙珠 下面2种操作: T u v 把u点所有龙珠搬到v Q u 问u点当前所在城市 u点所在城市有几个龙珠 u点被移动几次 思路: 并查集可以求出 u ...
- 【STL学习】智能指针之shared_ptr
前面已经学习过auto_ptr,这里补充另外一种智能指针,比auto_ptr要更强力更通用的shared_ptr. shared_ptr 简介及使用选择 几乎所有的程序都需要某种形式的引用计数智能指 ...
- PowerDesigner 业务处理模型( BPM )
PowerDesigner 业务处理模型( BPM ) 说明 properties语言文档xmlvalidation数据库 目录(?)[+] 一. BPM 简介 业务处理模型(Busi ...
- 如何关闭log4j中配置的spring或者hibernate的日志信息
通常在建立一个web项目的时候,我们通常需要为其配置日志,以便了解启动过程中发生了什么,如果启动过程中发生了错误,则可以很方便的查看错误的信息,但是在项目部署到服务器上时,打印日志信息,需要耗费大量的 ...
- NSArrary和NSString间的转换
将string字符串转换为array数组 NSArray *array = [Str componentsSeparatedByString:@","]; // 注意:NSArr ...
- dotnetfx35.exe
http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-fdaa79a8ac3d/dotnetfx35.exe
- 网络防火墙实战-基于pfsense(2)
安装虚拟机 本博客所有内容是原创,如果转载请注明来源 http://blog.csdn.net/myhaspl/
- File类的基本操作之读出所有目录路径
package org.mark.file; import java.io.File; /** * File类的基本操作之读出所有文件夹路径 * 假设给定一个文件夹,要求将此文件夹中的所有文件都列出来 ...
- 06---Java基础、面向对象
一.Java基础 1.Java概述 Java语言特点: 简单性.解释性.面向对象.高性能.分布式处理 多线程.健壮性.动 ...
- mysqldump原理3
现网中数据库运维时,要经常对数据库做热备.为保证恢复时数据的完整性与一致性, 一种方法是在备份之前锁表,但锁表会影响正在运行的业务. mysqldump是当前MySQL中最常用的备份工具,通过mysq ...