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在快速输入清除时报错解决方法的更多相关文章

  1. mysql truncate带有被引用外键的表时报错解决方法

    清空具有外键约束的表时报ERROR 1701(42000)的解决   mysql> truncate table t_users;ERROR 1701 (42000): Cannot trunc ...

  2. rebuild online时意外中断 再次重建时报错解决方法

    rebuild online时意外中断 再次重建时报错 SQL> alter index PARTY.IDX_CM_INDIV_CUSTOMER_4 rebuild online; alter ...

  3. 安装redis 执行make命令时报错解决方法

    一.未安装GCC 解决方法:执行yum install gcc-c++命令安装GCC,完成后再次执行make命令 yum install gcc-c++ Linux无法连接网络 http://www. ...

  4. XML节点名称中有小数点处理(deal with dot)导致使用xpath时报错解决方法

    <?xml version="1.0"?> <ModifyFiles> <_Layout.cshtml>123456</_Layout.c ...

  5. python运用中文注释时报错解决方法

    写了一段简单的代码,不知 为什么总是报错,后来上网查了一下才知道原因,当用中文进行注释时需要添加如下代码:# coding=utf-8          (注意:该段代码必须放在最前面才能有用,并且 ...

  6. react创建项目后运行npm run eject命令将配置文件暴露出来时报错解决方法

    最近在用create-react-app创建项目,因要配置各种组件,比如babel,antd等, 需要运行npm run eject命令把项目的配置文件暴露出来,但是还是一如既然碰到报错,因为是在本地 ...

  7. 解决loadrunner在脚本回放时长时间等待及在vugen中create controller scenario时报错的方法!超管用!!

    解决loadrunner在脚本回放时长时间等待及在vugen中create controller scenario时报错的方法 经过咨询,有两种方法.经过实践,下面的方法1有效,方法2无效(我下载安装 ...

  8. asp.net MVC webservice 报次错解决方法

    asp.net  MVC  webservice  报次错解决方法: 解决方法: 在 RouteConfig.cs public static void RegisterRoutes(RouteCol ...

  9. redhat linux enterprise 5 输入ifconfig无效的解决方法

    redhat linux enterprise 5 输入ifconfig无效的解决方法   在安装完成linux后,进入终端,输入命令行ifconfig,会提示bash: ifconfig: comm ...

随机推荐

  1. jQuery语法总结及注意事项

    1.关于页面元素的引用通过jquery的$()引用元素包括通过id.class.元素名以及元素的层级关系及dom或者xpath条件等方法,且返回的对象为jquery对象(集合对象),不能直接调用dom ...

  2. 原”zencart建站仿站俱乐部”现升级为”zencart 学院“!

    特别告示: 原”zencart建站仿站俱乐部”现升级为”zencart 学院“!

  3. CentOS 6.5安装TortoiseSVN svn client

    TortoiseSVN: TortoiseSVN 是 Subversion 版本号控制系统的一个免费开源client,能够超越时间的管理文件和文件夹. 文件保存在中央版本号库,除了能记住文件和文件夹的 ...

  4. 【剑指Offer学习】【全部面试题汇总】

    剑指Offer学习 剑指Offer这本书已经学习完了.从中也学习到了不少的东西,如今做一个总的文件夹.供自已和大家一起參考.学如逆水行舟.不进则退.仅仅有不断地学习才干跟上时候.跟得上技术的潮流! 全 ...

  5. 一个 Android 任务队列的实现

    最近在做Android项目时遇到这样一个问题:客户端向服务器请求数据,而在网络信号太差的情况下,数据迟迟不到,甚至丢失.服务器为了解决这个问题做了频繁的重发,android 客户端就会收到很多不想要的 ...

  6. C _数据结构 _线性表的顺序存储

    #ifndef __MY_SEQLIST_H__ #define __MY_SEQLIST_H__ typedef void SeqList; typedef void SeqListNode; // ...

  7. CodeMachine Debugger Extension DLL

    http://www.codemachine.com/downloads.html http://www.codemachine.com/tool_cmkd.html#stack

  8. 获取用户ip接口

    <script type="text/javascript" charset="gb2312" src="http://counter.sina ...

  9. qt helper

    qt帮助文档(中文版) http://www.kuqin.com/qtdocument/index.html qt基础 http://www.devbean.net/2012/08/qt-study- ...

  10. C#基础篇03

    1:不管是实参还是形参,都在内存中开辟空间. 2:写一个方法,它的功能一定要单一,方法中最忌讳的就是出现提示用户输入的字眼. 3:out参数 如果在一个方法中,返回多个类型相同的值时,可以考虑返回一个 ...