PDA

View Full Version : [AS3] Add event listener to AMFPHP gateway


RR_QQ
03-06-2008, 01:10 AM
Can anyone help me? I've been trying for hours to get this to work but haven't gotten anywhere. I have an AMFPHP remoting call to get data. that works fine. What I am trying to do is create an EventListener so that once the array returned by PHP is set to an AS3 ArrayCollection object the program know since the array is large size.

This is my remoting code:


gateway.addEventListener(ResultEvent.RESULT, onTestHandler);
gateway.call("MyService.getPhpData", new Responder(onGetgetPhpDataResult, onFault));

public function onTestHandler(event:ResultEvent):void
{
Alert.show("HELLO");
Alert.show(event.result.toString());
}

public function onGetgetPhpDataResult(result:Array):void
{
//Alert.show("test");
phpData= new ArrayCollection(result);
}


Can anyone point me in the right direction? I'm at a total loss...thank you.