Groups | Blog | Home
all groups > flash actionscript > june 2005 >

flash actionscript : ColdFusion Component Data Handling


jfillman
6/14/2005 9:07:10 PM
I have a very basic ColdFusion Component that returns a "Yes" or "No" value to
Flash. If the value is "Yes", I want it to output the word "Yes" to a
dataField, if "No" then I want the dataField left blank. I can't seem to get
the ActionScript syntax correct. In reality, my question is larger than the
example below. I'm going to be receiving a lot various data types from
ColdFusion Components and I need to know how to respond with ActionScript
coding, based on what value is returned from the Component. So if you'd answer
this question I would be very greatful, and if you could also point me to some
tutorials that deal with this, that would be even better.

Code is as follows:

#include "NetServices.as"
#include "NetDebug.as"

function Result()
{
this.onResult = function(result)
{
if (result = "Yes")
dataField.text = result;}
this.onStatus = function(error)
{
trace("Error : " + error.description);
//this is where we put the data in the text field
dataField.text = "Error : " + error.description;
}
}


NetServices.setDefaultGatewayUrl("http://localhost:8300/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("CFIDE.flash_remoting.HelloWorld", new Result());
server.sayHello();

jfillman
6/16/2005 8:05:19 PM
Please, anyone, I need some help. Below is the piece of the code that I can't
make work correctly. See the original message for the entire code.

function Result()
{
this.onResult = function(result)
{
if (result = "Yes")
dataField.text = result;}
this.onStatus = function(error)
{
trace("Error : " + error.description);
//this is where we put the data in the text field
dataField.text = "Error : " + error.description;
}
}
AddThis Social Bookmark Button