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

ActionScript
FLASH 3D相册之利用BitmapData类制作
Flash 脚本游戏开发教程 第一课
Flash 脚本游戏开发教程第二课
Flash 脚本游戏开发教程第三课
Flash 脚本游戏开发教程第四课
Flash 脚本游戏开发教程第五课
Flash 脚本游戏开发教程第六课
Flash 脚本游戏开发教程第七课
Flash 脚本游戏开发教程第八课
Flash AS实现的蝌蚪摆尾动画的教程
从基础开始深入学Flash AS3教程(4)(译文)
从基础开始深入学Flash AS3教程(5)(译文)
从基础开始深入Flash AS3教程(2)(译文)
从基础开始深入学Flash AS3教程(3)(译文)
Flash AS3对单个图片进行角色动作化处理
从基础开始深入Flash AS3教程(1)(译文)
Flash教程:if条件语句的用法
Flash AS教程:_visible属性的详细讲解
Flash AS教程:图片环绕旋转效
Flash教程:trace()的使用

ActionScript 中的 Flex教程:ScriptLimits标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-30   浏览: 154 ::
收藏到网摘: 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)。