Groups | Blog | Home
all groups > coldfusion flash integration > february 2006 >

coldfusion flash integration : CFC Query Data Refresh


doug777
2/21/2006 12:00:00 AM
Put this inside your cfform

<cfformitem type = "script">
function myFunc():Void {
<cfoutput>
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection("http://#cgi.HTTP_HOST#/flashservices/gateway/");
var componentPath =
"Path_From_wwwroot.NameOfCFC";//e.g."mySite.myCFC" (don't add .cfc)
</cfoutput>

var myService:mx.remoting.NetServiceProxy;
var responseHandler:Object = {};

responseHandler.onResult = function(results:datatype):Void {//where
datatype is the ActionScript datatype for whatever the CFC returns
//code to handle the result of the CFC call
}
responseHandler.onStatus = function(stat:Object):Void {
alert("Error: " + stat.description);
}

myService = connection.getService(componentPath, responseHandler);
myService.myMethod();//where myMethod is the function name in the CFC
}
</cfformitem>

OwenWest
2/21/2006 2:20:42 AM
Hi,

I have a flash form that displays status data (from SQL queries) for three
different EDI interfaces on three servers. This is simply a static display for
status monitoring and does not need any user interaction. Currently the form
refreshes itself (and the underlying data) every 30 seconds. The data is
sourced from a CFC and three functions.

What I would like to do is to have the data refresh itself every 30 seconds
without having to reload the flash form. I understand that this can be done via
flash remoting, but I have not used that before and I am not sure where to
start.

Any help would be most appreciated.

Thanks,

Owen West
Hunter New England Health Service
owen.west@hnehealth.nsw.gov.au
AddThis Social Bookmark Button