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

ActionScript
Flash AS教程:图片环绕旋转动画
Flash贪吃蛇游戏AS代码翻译
Flash AS教程:旋转立方体
Flash AS3教程:ImageLoader类
Flash AS3教程:疑难杂症汇总
Flash AS3教程:类的分包处理
Flash AS3教程:Dot类
Flash游戏开发:BitmapData的使用
初学AS3的几点技巧汇总
飘雪Flash动画简单制作
Flash air制作淡入淡出窗体动画效果
Flash air制作透明雪花特效
Flash AS制作LRC歌词同步的详细教程
Flash as3:绝对坐标与相对坐标
Flash AS3用于读取LRC同步歌词的类
优化Flash Actionscript代码的三种方法
AS3的System类解决歌词中乱码问题
Flash as3嵌入中文字体的方法
Flash AS3教程:ClassLoader类
Flash AS3教程:ByteLoader类

ActionScript 中的 Flex教程:ScriptLimits标签


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