Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Flash Integration / October 2004



Tip: Looking for answers? Try searching our database.

cf query to flash array?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dr_bozak - 27 Aug 2004 16:58 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.