Hello.

Class alias isn't connected to server, it tells the Flash Player or Air
runtime which class it should create when deserializing the chunk of data
possibly serialized using AMF format.
Essentially [RemoteClass] is a convenience feature. Using it you don't need
to remember to add or remove the registerClassAlias() call. However I don't
use it, because the generated code for it is silly :)
The code it transforms to looks like this:

try

{

    if (flash.net.getClassByAlias("foo.bar.VO") == null)

    {
        flash.net.registerClassAlias("foo.bar.VO", foo.bar.VO);

    }
}

catch (e:Error)

{
  flash.net.registerClassAlias("foo.bar.VO", foo.bar.VO);

}


while all that you really need is the last line.
Note that getClassByAliass can never return null, it throws if the alias
wasn't registered.

Best.

Oleg

Reply via email to