Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flash Actionscript委托函数出现故障。。。(myFunction).toString()打印函数(){}_Flash_Actionscript 3_Delegates_Anonymous Function - Fatal编程技术网

Flash Actionscript委托函数出现故障。。。(myFunction).toString()打印函数(){}

Flash Actionscript委托函数出现故障。。。(myFunction).toString()打印函数(){},flash,actionscript-3,delegates,anonymous-function,Flash,Actionscript 3,Delegates,Anonymous Function,我有一个ViewToActionMap对象的向量,它有以下构造函数: public function ViewToActionMap(_forModule:eModule, _forAction:eViewAction, _toFunction:Function, _withArgs:Array=null

我有一个
ViewToActionMap
对象的向量,它有以下构造函数:

public function ViewToActionMap(_forModule:eModule, 
                                _forAction:eViewAction,
                                _toFunction:Function,
                                _withArgs:Array=null):void{         
            forModule   = _forModule;
            forAction   = _forAction;
            toFunction  = _toFunction;
            withArgs    = _withArgs;
        }
eModule
/
eViewAction
/
带args
与我的帖子无关)

所以我的向量看起来像这样(为了简单起见,我只包含了它的第一个对象..):

///////////////这就是问题所在//////////////

如果我遍历actionMappings[0]的属性,则输出如下:

gpContinueButton
welcome
function Function() {}    //<---------- why isn't this working?
null
gpContinueButton
欢迎
function(){}/解决了它:

似乎跟踪
“.toFunction”
的值只会得到以下结果:
function(){}


一旦我修复了一个不相关的bug,我就能够成功地调用startGame()。

startGame是否包含任何逻辑行?如果您仅出于示例目的而省略它们,我深表歉意。不,还没有:
函数startGame():void{trace(“call me!”)};)哈哈,我没有把它贴对(“;”结尾)。。。我认为这会导致编译器错误P
function startGame():void{  }
gpContinueButton
welcome
function Function() {}    //<---------- why isn't this working?
null