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 ...
随机推荐
- 利用SQOOP将ORACLE到HDFS
#Oracle的连接字符串,其中包含了URL,SID,和PORT URL=jdbc:oracle:thin:@132.232.19.79:10521:szdw #使用的用户名 USERNAME=szd ...
- iis启动网站提示 文件正在使用
通常是端口被占用,使用netstat -ano,查看占用的进程pid,结束
- C++ 继承的访问权限
1.它解决什么问题?为什么设计出继承的各种访问权限? 可以这样认为,C++继承会把父类的东西拉到自己这里,这些东西都是自己的,父类中的字段和方法都有访问权限,如果我想改变这些东西的访问权限,该怎么办? ...
- Centos部署nagios+apache实现服务器监控
1.Nagios介绍 nagios是 一款功能强大的网络监视工具,它可以有效的监控windows.linux.unix主机状态以及路由器交换机的网络设置,打印机工作状态等,并将状态出 现异常的服务及时 ...
- 从问题看本质: 研究TCP close_wait的内幕
Socket应用服务器TomcatOSUbuntu /* * @author: ahuaxuan * @date: 2010-4-30 */ 最近遇到的一个关于socket.close的问题,在某个 ...
- C#获取指定网页源码的几种方法
// WebClient private string GetWebClient(string url) { string strHTML = ""; WebClient myWe ...
- Linux 学习笔记 基本的bash shell命令
Linux 文件系统 Linux讲文件存储在单个目录结构(虚拟目录)中,虚拟目录包含了安装在PC上的所有存储设备的文件路径. Linux虚拟目录中比较复杂的部分是它如何来协调管理各个存储设备.Linu ...
- failed to obtain a cell from its dataSource
stroyboard没有绑定标示 没有注册标示 cell为空时没有创建
- debian 颜色设置
root@debian:/# vi /root/.bashrc #export PS1='\h:\w\$ 'export PS1='\[\033[1;32;40m\]\u@\h:\w\$ \[\033 ...
- IE兼容低版本
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><m ...