Hello. I am posting this in the cf section as well because I am not really sure
if the probelm is with my cf component or the flash movie.
probably my ignorance of how to use flash is why this isn't working. Randomly
guessing solutions in getting old and I find no reference anywhere on how to do
this (except of course in the marketing section of how awesome remoting is)
specifically, I am trying to get a cfc return an array into a flash movie.
I am trying to replace
pic_arr = ['1','2','3','4']
with
pic_arr = [array result from CFC]
8*******************************************
slides.cfc looks like: (is this correct?)
<cfcomponent displayName="grabSlides">
<cffunction name="grabSlides" access="remote" returnType="array">
<cfquery name="rsGrabSlides" datasource="fresh" >
SELECT Picture
FROM PICS
</cfquery>
<cfset returnArray = ArrayNew()>
<cfset returnArray = grabSlides>
<cfreturn returnArray>
</cffunction>
</cfcomponent>
*****************************************'
AS in .fla file looks like this: I am so far just testing to see if flash will
read the array from CFC.
if (connected == null) {
connected = true;
NetServices.setDefaultGatewayUrl("http://flashfusion.net/flashservices/gateway")
;
var my_conn = NetServices.createGatewayConnection();
var myService = my_conn.getService("slides",this);
}
myService.grabSlides();
function grabSlides_Result(result) {
trace(arrayResult.length);
trace(arrayResult); // outputs: a,b,undefined,undefined,undefined
}
*****************************
since flash shows no output, the debugger is inactive (now that's a useful
feature!), I am having a bit of a time debugging this.
any ideas or corrections to how to accomplish this "simple" task are
appreciated.
Pete - 05 Oct 2004 22:10 GMT
ColdFusion Query objects come back to the client as ActionScript Objects of
type "RecordSet" - not arrays.
If you want the individual rows, then try accessing the items from the
result, i.e. reference result.items to get an array of rows from the query.