0
嗨我正在编写一个Flex应用程序,它具有一个根据用户在MainMovie中选择的内容加载Flex程序(ChildMovie)的MainMovie。下面是一些伪代码,希望帮助我描述我的问题。未调用子电影中的URLLoader处理程序
class MainMovie{
private var request:URLRequest = new URLRequest();
public function callPHPfile(param:String, loader:URLLoader,
handlerFunction:Function):void {
var parameter:URLVariables=new URLVariables();
parameter.param = param;
request.method = URLRequestMethod.POST;
request.data = parameter;
request.url = php file on server;
loader.addEventListener(Event.COMPLETE, handlerFunction);
loader.load(request);
}
}
Class ChildMovie {
private var loaderInChild:URLLoader = new URLLoader();
public function handlerInChild(e:Event):void {
process data....
loaderInChild.removeEventListerner(Event.COMPLETE, handlerInChild);
}
private function buttonClickHandler(e:Event):void{
Application.application.callPHPfile(param, loaderInChild, handlerInChild)
}
}
我可以看到正被执行,并从在接收到的是HttpFox XML数据callPHPfile功能,问题是没有被执行在handlerInChild函数的代码。我在这里做错了什么?