|
Mailing Lists
|
Home / Groups / ColdFusion Flash (CF-Flash)
getting a datagrid to display data with ColdFusion & remotingHow To Use the AS3 FlashRemoting Class 1) Create an instance of the FlashRemoting class -The constructor takes the location of the flash remoting servcie as its only parameter 2) Set a "onLoad" handler to handle the results coming from the server 3) Use the "load" function to send a flash remtoing call to the coldfusion server. This takes 2 parameters a) the cfc and function you want to call b) parameter. This only takes 1 parameter. If you want to pass multiple variables, place then into an object and pass the object 4) There is a function called "toQuery" that takes a recordset from coldfusion and turns it into an object with index arrays Working Example --------------------------------------------------------------- //Create an indexed array with values, this will be the parameters passed to the coldfusion server var array = new Array() array[0] = 'car' array[1] = 'boat' array[2] = 'ship' //Create new instance of the FlashRemoting Class var fr:FlashRemoting = new FlashRemoting('http://www.mydomain.com/flashservices/gateway') //Set the onLoad handler for when the flash gets the server response fr.onLoad = function(obj){ //I'm expecting a query, so use the "toQuery" function var myQuery = this.toQuery(obj) } //Call the method on the remoting cfc (relative to the gateway url) fr.load('nameOfCFC.nameOfFunction', array) --- On Sat, 4/4/09, John Barrett <barrjohnm@yahoo.com> wrote: From: John Barrett <barrjohnm@yahoo.com> Subject: Re: getting a datagrid to display data with CF & remoting To: "cf-flash" <cf-flash@houseoffusion.com> Date: Saturday, April 4, 2009, 10:37 PM Hi Tyron, thanks so much for your help`-` I found an example on flash-db. Seems like there is an error in there code, as I get "TypeError: Error #1034: Type Coercion failed: cannot convert Object@d7fe101 to flash.events.Event." Is this because of not looping through the object to get the data? Thanks again for your help, John ________________________________ From: Tyron Foston <tfoston@yahoo.com> To: cf-flash <cf-flash@houseoffusion.com> Sent: Saturday, April 4, 2009 4:21:02 AM Subject: Re: getting a datagrid to display data with CF & remoting In as2, you could pass a recordset back to the flash but in as3, the recordset object is only for adobe air. So when you pass a recordset back into as3, it comes into the flash player as an object instead of a recordset, so you'll have to loop through the object to get the data --- On Fri, 4/3/09, John Barrett <barrjohnm@yahoo.com> wrote: From: John Barrett <barrjohnm@yahoo.com> Subject: getting a datagrid to display data with CF & remoting To: "cf-flash" <cf-flash@houseoffusion.com> Date: Friday, April 3, 2009, 10:38 PM Hi, I finally got flash a ColdFusion to talk to each other, and now I am trying to query a database and display those results in a AS 3 datagrid in flash. Can somebody help me out with this, or if you know a blog or tutorial that might help me I would really appreciate it. I found some using php, but I am using cfcs. Thanks, John |
February 12, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||