views:

47

answers:

1

Hi in Flex one can easily define the remote class alias like the following:

package samples.portfolio
{
 [RemoteClass(alias="flex.samples.marketdata.Stock")]
 [Bindable]
 public class Stock
 {     
  public var symbol:String;
  public var name:String;
  public var low:Number;
 }

}

But my question is how do you do it in AIR since the client app does not know about the server file structure.

Regards,

+1  A: 

In your example above, you are hard coding the server side structure in the RemoteClass metadata tag. You allude to the fact that a Flex, web based, app knows something about the server side structure. It doesn't. It only knows what you tell it.

You can do it the same way in an Flex desktop based app using AIR.

www.Flextras.com
This is correct. Flex apps whether in the browser (Flash Player) or on the desktop (Adobe AIR) can both use the RemoteClass metadata to associate a class with an alias. The alias is used when serializing from / to AMF.
James Ward