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. Winform- IrisSkin.dll轻松实现窗体换肤功能

    IrisSkin2.dll是一款很不错的免费皮肤控件,利用它可以轻松的实现winForm窗体换肤 然而IrisSkin2.dll只能在.NET Faremwork 4.0以及之前的版本使用,所以要在V ...

  2. CGAffineTransform相关函数

    CoreGraphics.h CGAffineTransform rotation = CGAffineTransformMakeRotation(M_PI_2);
[xxx setTransform ...

  3. Codeforces Round #322 (Div. 2) C. Developing Skills 优先队列

    C. Developing Skills Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/p ...

  4. 访谈将源代码的函数 strcpy/memcpy/atoi/kmp/quicksort

    一.社论 继上一次发表了一片关于參加秋招的学弟学妹们怎样准备找工作的博客之后,反响非常大.顾在此整理一下,以便大家复习.好多源自july的这篇博客,也有非常多是我自己整理的.希望大家可以一遍一遍的写. ...

  5. Swift概览

    <pre name="code" class="objc">转自:http://letsswift.com/2014/06/swift_overvi ...

  6. 启动hbase时,hregionserver没有启动的原因

    今天配置hbase的时候发现有几台机器的regionserver启不来.报错例如以下: at sun.reflect.NativeConstructorAccessorImpl.newInstance ...

  7. wcf-2

    1.前言 上一篇,我 们通过VS自带的模板引擎自动生成了一个wcf程序,接下来我们将手动实现一个wcf程序.由于应用程序开发中一般都会涉及到大量的增删改查业务,所以这 个程序将简单演示如何在wcf中构 ...

  8. js 数组排序要注意的问题,返回的值最好为 -1, 0, 1之间的值

    var test10Elements = [7, 6, 5, 4, 3, 2, 1, 0, 8, 9]; var comparefn = function (x, y) { return x - y; ...

  9. 【转】MySQL数据库主从同步管理

    MYSQL主从同步架构是目前使用最多的数据库架构之一,尤其是负载比较大的网站,因此对于主从同步的管理也就显得非常重要,新手往往在出现主从同步错误的时候不知道如何入手,这篇文章就是根据自己的经验来详细叙 ...

  10. centos7下载安装谷歌浏览器

    centos7安装完成结束后,发现自带的火狐浏览器不太习惯,自己还是习惯谷歌浏览器,因为是新手嘛,所以自己就各种找教程看如何下载安装谷歌浏览器,一个一个按照教程试验,终于最后试验成功了一个,亲测可用. ...