Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remoting to a CFC

Status
Not open for further replies.

lucidtech

IS-IT--Management
Jan 17, 2005
267
0
0
US
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.

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() {
}
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:
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);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top