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完成带复选框的表格行高亮显示

    jquery完成带复选框的表格行高亮显示 通过jquery技术来操作表格是件简单的事,通过jquery的语法,可以很轻松的完成表格的隔行换色,悬浮高亮,在实际的应用中可能会出现表格中带复选框的,删除时 ...

  2. 曾经的pc端项目踩到的一些兼容性的坑及其解决方案

    曾经公司pc端项目一直最低兼容到IE7,要求和chrome下浏览效果一致,真心坑坏了我和另外一个小伙伴(另一个小伙伴以前也没处理过兼容问题).不过还好,在这里真心感谢鑫哥博客的详解,从底层原理讲到了具 ...

  3. C++学习笔记(一):头文件和源文件

    说明: 当一个源文件(a.cpp)要调用另一个源文件(b.cpp)定义的方法时,需要在a.cpp中写上这个方法的声明(只需要该方法的名称.返回值和参数,类似Java的接口): 如果每次调用其他文件的方 ...

  4. DataTable 基本转换简单实例

    var query = from dt in tblProduct.AsEnumerable() where dt.Field<string>("StockNo") = ...

  5. fastica matlab 转载

    FastICA工具箱1 http://chunqiu.blog.ustc.edu.cn/?p=68#comment-3512 FastICA代码网址如下:http://research.ics.aal ...

  6. The Sorrows of Young Werther

    The Sorrows of Young Werther J.W. von Goethe Thomas Carlyle and R.D. Boylan Edited by Nathen Haskell ...

  7. spring读书笔记----Quartz Trigger JobStore出错解决

    将Quartz的JOBDetail,Trigger保持到数据库的时候发现,系统报错 The job (DEFAULT.jobDetail) referenced by the trigger does ...

  8. 提高你的Java代码质量吧:少用静态导入

    一.分析  从Java 5开始引入静态导入语法(import static),其目的是为了减少字符输入量,提高代码的可阅读性,以便更好地理解程序. 但是,滥用静态导入会使程序更难阅读,更难维护.静态导 ...

  9. $_SERVER详细资料整理(转)

    PHP编程中经常需要用到一些服务器的一些资料,特把$_SERVER的详细参数整理下,方便以后使用. $_SERVER['PHP_SELF'] #当前正在执行脚本的文件名,与 document root ...

  10. ThinkPHP CURD方法盘点:order方法

    order方法属于模型的连贯操作方法之一,用于对操作的结果排序. 用法 $Model->where('status=1')->order('id desc')->limit(5)-& ...