Hello,
 
Lets say you have an AS class:
 
[RemoteClass(alias="MyVO)]
public class MyVO
{
    public var name:String;
};
 
and a corresponding CFC:
 
<cfcomponent displayname="MyVO">
    <cfproperty name="name" type="string" />
   <cfset variables._name_str = "" />
 
   <cffunction name="getName" access="public" returntype="string">
      <cfreturn variables._name_str />
   </cffunction>
 
   <cffunction name="setName" access="public" returntype="void">
      <cfargument name="name" type="string" required="true" />
      <cfset variables._name_str = arguments.name />
   </cffunction>
</cfcomponent>
 
 
If you send back an instance of MyVO to flex, the ColdFusion Remoting adapter will automatically serialize is as an object with the classname MyVO. When it reaches Flex (because of the RemoteClass tag) it will be automatically converted to the actionscript version of MyVO.
 
>do the AS & CFC objects have to match exactly? ie methods too?
 
There is no need to completely match it, its however good practice to let all properties match.
 
One warning: When sending stuff from CF to Flex the AMFserializer will not include properties defined in the super cfc's (cfc's that are extended). So you need to include cfproperty tags for all available properties (even the ones that are allready set in the super class).
 
Hope this helps.
 
 
Greetz Erik
 
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to