PDA

View Full Version : Problems with Flash API


clam61
10-12-2010, 05:27 AM
I am trying out hessian in flash. I have this code in the first frame of my fla:

import hessian.client.HessianAsyncToken;
import hessian.client.HessianProxy;
import hessian.events.*;
var proxy:HessianProxy = new HessianProxy("myserviceurl");

var token:HessianAsyncToken;
token = proxy.hello();

token.addEventListener(HessianResultEvent.HESSIAN_ RESULT,result);
token.addEventListener(HessianErrorEvent.HESSIAN_E RROR,error);

function error(event:*) {
trace(event.error);
}

function result(event:HessianResultEvent):void
{
trace(event.result);
}

And an error event is thrown:

TypeError: Error #1009: Cannot access a property or method of a null object reference.


The thing is, I am monitoring the traffic via a program (Charles) and I can see the request from the swf and response from my PHP Hessian service.

Anyone have success using the hessian flash api?