I put remoting in the title with much trepidation because my trawling of the net shows that it almost always guarantees no reponse, so I hope this forum acts differently. My program runs from the AS3 CS6 IDE and communicates with ColdFusion 11 on the same PC. This is (most of) my program:
import flash.net.NetConnection;
import flash.net.Responder;
import flash.events.Event;
import flash.net.ObjectEncoding;
trace("arrived in " +"Test");
var myService = new NetConnection();
myService.objectEncoding = 0;
myService.connect("http://localhost:8500/flashservices/gateway");
var responder = new Responder(test1CFReturn_Result, getFault_Fault);
myService.call("cfc.temp.test1CFReturn", responder);
stop();
function test1CFReturn_Result(re:Object):void
{
trace("test1CFReturn_Result");
trace("Status : " +re.STATUS); // the word "ALLOK" from the CFC
trace("Count : " +re.RECCOUNT); // the number of records the query retrieved
trace("init data : " +re.DATA.serverInfo.initialData); // all of the data retrieved with each field separated by a comma
trace("init data[0] : " +re.DATA.serverInfo.initialData[0]); // the first record with each field separated by a comma
trace("init data[0][0] : " +re.DATA.serverInfo.initialData[0][0]); // the first field of the first record
trace("init data[0][1] : " +re.DATA.serverInfo.initialData[0][1]); // the second field of the first record
}
As you can see, I can process the data but unlike AS2, where we have the RECORDSET object and can extract data by using the database field name, I must use indexes. I’m sending exactly the same data in exactly the same format but I can see no field names. Is this my crude processing or is the data from CF “translated” in some way?