1 person found this helpful
What is ncDB? Is it a remote object?
Remote object don't have a connect method. Istead you should set the endpoint, source and destination properties.
If you handle your requests through AS3, you could do the following. I use this code in a singleton class.
in the constructor:
ws.RemoteObject = new RemoteObject();
ws.destination = "amfphp";
ws.source = "nameOfYourService";
ws.endPoint = "linkToYourGateway.php";
In a method named 'call':
public function call(endPoint:String = null, serviceMethod:String, resultFunction:Function = null, ...args):void
if (endPoint != null)
ws.endPoint = endPoint;
if (resultFunction == null)
resultFunction = defaultResult;
ws[serviceMethod].arguments = args;
Does this help?
Thanks a lot for the reply! I must say I didn't really understand the code you provided, but I searched the web and I used http://sujitreddyg.wordpress.com/2008/09/04/invoking-php-functions-from-flex-using-amfphp/ to make it work with a remote object. Now it seems to work fine, but I wonder what I did wrong the last time. The ncDB that you were asking about was a netConnection, and I'm pretty sure this is also a right way to do this, as I still use my applications that use netConnection and amfphp to work with mySQL database.
Thanks for help and I think the problem is solved, although I wouldn't mind if someone told me where did I go wrong in my previous attempt