I have my AS3 file setup for remoting. The code connects to a CFC file, calls a function in that file and gets a result. The result is in the form of a query performed by the CFC (nothing special, just a few columns and rows of data). How do I get the data from the result. Here's what I've got so far.
What I'm used to is AS 2.0 Here's an example of what I'm trying to do but written in AS 2.0
Code:
//declare remoting service
var myService = new NetConnection()
myService.connect("[URL unfurl="true"]http://localhost:8500/flashservices/gateway/")[/URL] //modify if neccesary to match your own
//load handler
var responder:Responder = new Responder(onResult, onFault);
myService.call("Folder.FolderTransactions.getMobs", responder);
function onResult(responder:Object):void {
trace(responder.health[0])
}
function onFault() {
}
Code:
import mx.remoting.NetServices;
import mx.remoting.Service;
import mx.rpc.FaultEvent;
import mx.transitions.Tween;
import mx.transitions.easing.*;
NetServices.setDefaultGatewayUrl("[URL unfurl="true"]http://localhost:8500/flashservices/gateway/[/URL] ");
gateway_conn = NetServices.createGatewayConnection();
_global.myService = gateway_conn.getService("Folder.FolderTransactions", this);
myService.getMobs();
function getMobs_Result(result) {
trace(result.items[0].health);
}