您的位置:首页 > 职场人生

FSCommand /getURL 重复使用 bug

2009-05-20 16:41 211 查看
写念佛机的时候,在同一帧连续用到了两个FSCommand ,就跟下面的一回事:

 

onUnload = function(){

fscommand("ulist");

 

fscommand("uole");

}

 

结果在VB里面试试老是漏掉一个command,测试一下:

 

Private Sub sf_FSCommand(ByVal command As String, ByVal args As String)

Debug.Print command

End Sub


 

输出uole,没了?没了!看来好像不是我的错。

 

最后在网上找到了相关文章:http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in-Flash-Player-9

 

 

我晓得了~只有Flash player 9才有这问题,而我用CS3发布的最新版就它,既然说:

 

Each call is added to an associative array (also called a map) based on the value of its argument (not the command name or the URL). If the argument does't exist in the map it's added to the end, which preserves the order of execution. So far no problem, until we encounter two commands with the exact same argument string. In this case, the call already in the map is replaced by the new one being added instead of just being added to the end of the map. The order of execution has now been changed and one calls has been blown away. The more calls you make, the more confusing the results will seem.

就只好改改看:

 

onUnload = function(){

fscommand("ulist","-");

 

fscommand("uole");

}

 

得行咯。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐