Mannequin
02-15-2004, 05:57 PM
I'm using FlashMX and ColdFusion to make requests to the database. I'm trying to return two variables.
Here is the CFC Code:
<cffunction name="getAbout" returntype="query" access="remote">
<cfargument name="sectionName" required="yes" type="string" default="home">
<cfquery name="content" datasource="myDS">
select_statement_here
</cfquery>
<cfset imageDirectory = "downloads">
<cfreturn content>
<cfreturn imageDirectory>
</cffunction>And here is the Actionscript:
var sectionName = "home";
...connection data...
server.getAbout(sectionName);
function getAbout_result(result) {
textdata.text = result.items[0].content;
imageDir.text = imageDirectory;
}
I successfully called the first variable - "content" - but I can't call the second one "imageDirectory". How do I do this? It should be pretty simple but I just can't seem to figure it out.
I'm thinking that because the CFC Function is a "query" returnType that imageDirectory won't work... because it's not part of the query. It's just a string.
Does that mean I should put it into its own Function? And if so, how would I call this second function?
Thanks.
Here is the CFC Code:
<cffunction name="getAbout" returntype="query" access="remote">
<cfargument name="sectionName" required="yes" type="string" default="home">
<cfquery name="content" datasource="myDS">
select_statement_here
</cfquery>
<cfset imageDirectory = "downloads">
<cfreturn content>
<cfreturn imageDirectory>
</cffunction>And here is the Actionscript:
var sectionName = "home";
...connection data...
server.getAbout(sectionName);
function getAbout_result(result) {
textdata.text = result.items[0].content;
imageDir.text = imageDirectory;
}
I successfully called the first variable - "content" - but I can't call the second one "imageDirectory". How do I do this? It should be pretty simple but I just can't seem to figure it out.
I'm thinking that because the CFC Function is a "query" returnType that imageDirectory won't work... because it's not part of the query. It's just a string.
Does that mean I should put it into its own Function? And if so, how would I call this second function?
Thanks.