FluorineFx.NET

Class Mapping (AS3)

By using class mappings you can map an ActionScript class to a .NET class.

  • using [RemoteClass(alias=" ")] metadata tag

    You will specify the fully qualified class name of the .NET class as the value of alias

    Example:


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

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

    on the server-side we have an "OrderVO" class in the "com.ariaware.pizza.vo" namespace

    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; }
            }
        }
    }
  •  
  • using web.config file

    Note: use this option only if for some reason the previous option cannot be applied

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


    Note: "classMappings" section name is important as defines the "classMappings" config handler class ( this handler will read the mappings)
    Note: <type> tag is your .NET class full type name
    Note: <customClass> tag is your ActionScript class full type name