I’ve been using Flash Remoting via CFC & CF8 to an Access db extensively and successfully. Now for the first time it has failed and I’m stumped as to why. Here’s the scenario:
This Flash document has 3 main activities which occur in frames 1, 10, & 15. In frame 1, after some user interaction, it retrieves some records from the db into a global variable (using Recordset) the contents of which frame 10 then displays in a grid. The user selects an item from the grid which is placed in a global variable and execution moves to frame 15 which retrieves the specific record from the db and displays the contents.
The problem is in frame 15. The cfc passes back the contents of the query within a structure, a model I use all the time.
ie: <cfset replyStruct.details = qGetReceipt>
<cfset replyStruct.reccount = qGetReceipt.RecordCount>
<cfreturn replyStruct>
In flash I then execute the following:
trace(“getReceipt reccount :” +re.result.RECCOUNT+ “:”);
var recRS:RecordSet = RecordSet(re.result.DETAILS);
trace(“recRS :” +recRS.getLength()+ “:”);
The first line correctly says that 1 record was retrieved but the third line says that recRS is undefined! In DEBUG, I explore the re structure and it contains 1 record’s worth of data (record #0). So, it seems that line 2 didn’t do what was instructed. I then conducted some experiments under a new Flash document and the same code in frame 1 works fine but not in any other frame.
So, what going on here?