flash - 重新定义AS2中的函数

标签 flash actionscript actionscript-2

假设您在 AS2 中执行此操作:

_root.foo = function(x){
//Do stuff
}

以后可以这样重新定义吗

_root.foo = function(x){
//Do different stuff
}

最佳答案

是的,您可以在 AS2 中替换这样的函数,除非您尝试替换由 Flash 运行时在 ActionScript 之外实现的函数。因此您的示例代码将按您的预期工作。

关于flash - 重新定义AS2中的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15748539/

相关文章:

flash - 溢出 :hidden equivalent for movieclip

javascript - 当未安装或启用 Flash 时,显示图像代替 Flash .swf 文件

flash - AS3 : Does `FullScreenEvent` temporarily add things to the display list?

apache-flex - 在 ActionScript 中,有没有办法测试数据类型为 "Function"的变量是否存在

javascript - 在 DHTML 中用 ActionScript 替换 JavaScript

当鼠标悬停在 flash 上时,Javascript mousemove 事件不会触发

flash - IE 中的 Mediaelement.js 故障,没有闪回工作

php - 将数组从 Flash 传递到 PHP

node.js - nodejs net.createServer 大量数据进来

actionscript-2 - 如何在Flash游戏中安全地计时?