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!

flash remoting with coldfusion question

Status
Not open for further replies.

theotrain

Programmer
Mar 5, 2003
150
0
0
MX
does anybody know if its possible to return a variable to flash from a cfcomponent? in all the flash remoting examples ive seen only a single recordset is returned via <cfreturn myRecordSet>

so is it possible to:
1) return a standard variable, like a string or a number?
2) return multiple recordsets with one function call?

barring either of these is it possible to make a recordset out of the ether? meaning if i have several variables i want to return to flash could i make a recordset out of nothing and fill it with the information that i need to pass, without actually involving a database?

I know i can get the job done by returning a bunch of recordsets from a bunch of cffunctions. but i have ALOT of data and im trying to build something more efficient.

ideas?
 
I pass several recordsets and also strings, ints, etc back to flash by using an array. So something like

<cfset arrayResult = arrayNew(1)>

<cfquery name="someQuery" datasource="myDatasource">
Select * from myTable
</cfquery>

<cfset arrayResult[1] = someQuery>

<cfquery name="someQuery2" datasource="myDatasource">
Select * from myTable2
</cfquery>

<cfset arrayResult[2] = someQuery2>
<cfset arrayResult[3] = 1234>
<cfset arrayResult[4] = "myString">

<cfreturn arrayResult>

Just one thing to keep in mind is coldfusion starts arrays at 1, while flash starts them at 0.

This what you were looking for at all?
 
thanks. i was pretty cracked at the time i was thinking only queries were acceptable as the return type because i was getting an error if it wasnt a recordset. of course i had the returntype set to query like a dope. anyway thanks for the example i will probably do something along those lines because i have a lot of data id like to return from some of the methods, an array is perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top