Posted By

away4m on 11/20/10


Tagged

object Net remoting Reflection as3


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

away4m
olwarpaint
thastyle


auto register object aliases for remoting


 / Published in: ActionScript 3
 

URL: http://friendfeed.com/away4m

  1. public static function checkAlias(obj:Object):void {
  2. var cname:String = getQualifiedClassName(obj);
  3. cname = cname.split("::").join(".");
  4.  
  5. try {
  6. getClassByAlias(cname)
  7. } catch (e:Error){
  8. registerClass(obj);
  9. }
  10. }
  11.  
  12. public static function registerClass(cls:*):void {
  13. var cname:String = getQualifiedClassName(cls);
  14. var cname_fixed:String = cname.split("::").join(".");
  15.  
  16. if (!(cls is Class)){
  17. cls = getDefinitionByName(cname);
  18. }
  19.  
  20. registerClassAlias(cname_fixed, cls);
  21. }

Report this snippet  

You need to login to post a comment.