Here is an example of how to use the RemoteClass metadata in Flex to map Actionscript objects that map directly onto ColdFusion Component that is found on a remote server. The data then can be converted to an Actionscript class with the appropriate properties and referenced in another actionscript class or MXML. My Workspace is under wwwroot/

Download Example

;

package vo
{
/**
* @private
* What we need to do is map on this actionscript file
* the coldufusion component, this is done by using the Remote
* Class Metadata tag. so [RemoteClass(alias="from(wwwroot Folder).path.to.coldFusionCFC")]
* Everything has to match exactly between the variables declared here and the coldFusion arguments
* that will be declared in the CFC file otherwise it will not work at all. ALso we want this class to be
* Bindable so we can show some information to know that it works
*/
[RemoteClass(alias="RemoteClassExample.src.cfc.cfcVO")]
[Bindable]
public class ColdFusionFlexVO
{
/**
* @private
* What we will be creating are simple variables to
* prove the point, this can be used for a registration form for example.
* Make Sure when you write in the Coldfusion component you use the same
* exact name, case does matter.
* Now Go to the cfcVO.cfc file under cfc
*/
public var firstName:String;
public var lastName:String;
public var emailAddress:String;
public var password:String;

public function ColdFusionFlexVO()
{
}
public function toString():String
{
var result:String= " ";
result += "First Name : "+ firstName +"\n" +
"Last Name : " + lastName + "\n" +
"Email Address : " + emailAddress +"\n" +
"Passwrod : " + password;
return result;
}

}
}