易截截图软件、单文件、免安装、纯绿色、仅160KB

Flash as脚本执行出现15秒超时错误 记录

在执行flash的as脚本时,出现了15秒超时错误。查看adobe官网文档有相关描述
http://help.adobe.com/zh_CN/AS3LCR/Flash_10.0/runtimeErrors.html
出现15秒超时错误后,脚本可以继续执行 15 秒,然后将终止脚本并引发编号为 1503 的运行时错误(脚本在 30 秒内未能退出,终止其执行)。
应用背景: 在flash中有一按钮,增加了点击事件处理函数:flaClickHandle,再处理函数中通过ExternalInterface.call,调用jsp页面中的一js函数:callbackForFla,在该函数中,执行window.showModalDialog。
在测试中,前面执行正常,当将window.showModalDialog打开的模态窗口关闭时,原页面中的flash报15秒超时错误。
初步分析,在callbackForFla,中的window.showModalDialog函数,是在模态窗口关闭时才返回。flash将它调用的外部函数callbackForFla的执行时间,计作as脚本的执行时间,及flaClickHandle函数的执行时间。这种情况下很容易,出现15秒超时错误。因为一个模态窗口只开15秒,就关闭。
针对这种情况的一种解决方法,就是把window.showModalDialog换为window.open
更一般的解决方法时,更改flash发布设置中的超时时间(不推荐,治标不治本)
还有一中方法是(推荐):在flash要掉用的js函数中使用js中的定时器(setTimeout,setInterval)去执行真正的目标的函数,而本函数会很快返回。以上为例就是:
flaClickHandle-》ExternalInterface.call-》callbackForFla-》timerRun-》targetFun
function callbackForFla(){
    window.setTimeout("timerRun",100); //该语句的执行时间不会超过15秒
}
function timerRun(){
    window.showModalDialog...//或者其他targetFun函数
}


相关文档:

在网页中插入Flash的代码

在网页中插入Flash的代码有很多,下面提供一种仅供参考:
<object data="Flash文件的URL" type="application/x-shockwave-flash" width="宽度" height="高度">
<param name="movie" value="Flash文件的URL">
</object> ......

Debian 5.0 'Lenny' : Flash Player 10安装升级

Architecture: i386, amd64
Configure your system to use lenny-backports by adding this line to your sources.list
deb http://www.backports.org/debian lenny-backports main contrib non-free
How to install flashplugin-nonfree :
apt-get update
apt-get install flashplugin-nonfree
How to update flash ......

P0werPoint中插入Flash动画的另一种方法

P0werPoint中插入Flash动画的另一种方法
PowerPoint因其通俗易懂、容易上手而成为老师们制作课件的常用工具,而Flash是目前比较流行的动画制作软件,有时在PowerPoint课件中为了更形象地说明问题,希望可以插入Flash动画。
看过《中国电脑教育报》以前刊登过在PowerPoint中插入Flash动画的文章,基本方法是选择菜单&ldquo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号