I am trying to get the results of a cfquery to display in Flash. From what I
understand, it should be simple. I have the code below. The results show as
[object, Object]. What am I doing wrong? Please help.
Action Script:
import mx.remoting.NetServices;
import mx.remoting.NetDebug;
mx.remoting.debug.NetDebug.initialize();
import mx.remoting.DataGlue;
//set the default gateway URL
NetServices.setDefaultGatewayUrl("
http://66.241.245.41/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("epic.intro", new Result());
server.getintro();
function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
//trace("Data received from server : " + result);
//this is where we put the data in the text field
introView.text = result;
}
this.onStatus = function(error)
{
//trace("Error : " + error.description);
//this is where we put the data in the text field
introView.text = "Error : " + error.description;
}
}
Component:
<cfcomponent displayname="retrieveIntro">
<cffunction name="getintro" access="remote" returntype="query">
<cfquery datasource="epic" name="qgetintro">
Select intro
from intro
</cfquery>
<cfreturn qgetintro>
</cffunction>
</cfcomponent>