当前位置: 首页 > 图文教程 > Flash动画 > ActionScript > Flex教程:ScriptLimits标签

ActionScript
ActionScript3教程:语句实例
ActionScipt技巧和开发中会遇到的问题
Flash as3.0教程:弹性小球
flash as简单制作飘雪动画
Flash AS 教程:交互动画
Flash ActionScript 3.0教程:学习Dot类
Flash AS 教程:子类化显示对象
Flash AS 教程:动画事件
Flash AS 教程:创建文档类(Document class)
Flash AS 教程:帧循环
Flash AS 教程:类和面向对象编程
Flash AS 教程:构造函数(Constructor)
Flex程序开发心得小结
Flash游戏开发教程:第一节
FLASH中的元件能在Flex中完美使用
关于XML在FLASH中的应用
Flash AS教程:decorator Pattern
Flash AS实例教程:简单的loading
Flash教程:彻底学习RadioButton组件
Flash AS教程:复制粘贴类

ActionScript 中的 Flex教程:ScriptLimits标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-30   浏览: 157 ::
收藏到网摘: n/a

今天读SWF file format spec,注意到一个tag——ScriptLimits 很有意思。很久很久以前,as2的时候,flash的递归被限制为256级。实际上,这个限制正是通过这个tag描述的。该标签包含两部分:MaxRecursionDepth和ScriptTimeoutSeconds,分别表示最大递归深度和脚本超时,类型均为UI16,表示可取值范围为0 ~ (2^16)-1之间,即,最大递归深度可以被设置为65535级(递归应当被避免),脚本超时也可以如此之长(千万别这么写,谋杀浏览器)。

官方文档:
  The MaxRecursionDepth field sets the ActionScript maximum recursion limit. The default
setting is 256 at the time of this writing. This default can be changed to any value greater
than zero (0).
  The ScriptTimeoutSeconds field sets the maximum number of seconds the player should
process ActionScript before displaying a dialog box asking if the script should be stopped.
  Flex中,Application和WindowedApplication都有两个对应的属性:scriptRecursionLimit(default 1000)和scriptTimeLimit(default 60)。