Flash AS2函数可以有回调函数吗?

Flash AS2函数可以有回调函数吗?,flash,adobe,actionscript-2,Flash,Adobe,Actionscript 2,正如标题所示,我试图在ActionScript2中创建一个调用值和函数的函数,但我似乎无法让它使用该函数。这是我的密码 function fadeOut(seconds, callBackFunction){ _root.fader.activated = true; _root.fader.secs = seconds; if(fader.box._alpha >= 100){ callBackFunction(); trace("This part of

正如标题所示,我试图在ActionScript2中创建一个调用值和函数的函数,但我似乎无法让它使用该函数。这是我的密码

function fadeOut(seconds, callBackFunction){
_root.fader.activated = true;
_root.fader.secs = seconds;
if(fader.box._alpha >= 100){
        callBackFunction();
        trace("This part of the code is being called");
    }
}
这就是我调用函数的方式

function BlankFunction(){
        trace("working");
    }
_root.fadeOut(5, BlankFunction);

所以我得到的跟踪是“调用了这部分代码”,但我没有从用作回调的BlankFunction中得到“工作”。有没有可能在AS2中创建一个调用回调函数的函数?

您可以使用
callBackfunction.call(null)
调用它。
null
指定被调用函数中
this
的目标。另见

我建议在fadeOut的参数中也输入:Function:
Function fadeOut(秒:Number,callBackFunction:Function)