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

ActionScript
Flash as入门(4):AS常用语句
Flash as入门(5):学习AS数组
Flash as入门(6):文本与字符串⒒
Flash AS3鼠标事件使用详解
网页中flash的trace方法输出数据
Flash as入门(11):拖动与碰撞检测
AS教程:随机显示数字
Flash AS文本字段的透明度alpha变换
AS教程:对场景和MC添加鼠标监听
AIR设置:transparent和systemChrome
Flash AS3教程:flash.text.TextField
AS教程:理解变量作用域修饰符(modifier)
ActionScript3.0中类间传值问题解决
ActionScript3.0中类的定义以及类属性
Flash AS3教程:类属性的属性
ActionScript3.0教程:变量
ActionScript3.0教程:方法
ActionScript3.0教程:类的枚举
简单认识Flash as面向对象编程
Flash AS2教程:影片剪辑

ActionScript 中的 Flex教程:ScriptLimits标签


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