[翻译]:类映射(Class Mapping)

本文由唐勇翻译自FluorineFX官方文档(http://www.fluorinefx.com/docs/fluorine/index.html),转载请保留

使用类映射你可以将ActionScript中的类映射到.NET的类中。

使用 [RemoteClass(alias=" ")] 元数据标签
你需要指定.NET中完整修饰的类名和别名。

示例:

package com.ariaware.pizza.vo
{
     [RemoteClass(alias="com.ariaware.pizza.vo.OrderVO")]
     public class OrderVO
     {
         var name:String;
         var orders:Array;

         //Constructor
         function OrderVO ()
         {
         }
         ...
     }
}

在服务器端的 "com.ariaware.pizza.vo" 命名空间中有一个名为"OrderVO"的类

namespace com.ariaware.pizza.vo
{
     public class OrderVO
     {
         string _name;
         IList _orders;

         public OrderVO()
         {
         }

         public string name
         {
             get{ return _name; }
             set{ _name = value; }
         }

         public IList orders
         {
             get{ return _orders; }
             set{ _orders = value; }
         }
     }
}
使用web.config文件:
注:如果只是出于某种原因前面的方法不能适用时,才使用此选择

<classMappings>
     <classMapping>
         <type>.Net class name</type>
         <customClass>ActionScript class name</customClass>
     </classMapping>
</classMappings>


注: " classmappings "一节的名称非常重要,因为定义了" classmappings "配置处理程序类(本处理程序将经过映象)
注: <type>这里是你的.NET完整类名称
注: <customclass>这里是你的ActionScript完整类名称

转载于:https://www.cnblogs.com/flex/articles/1429214.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值