Return to Snippet

Revision: 36309
at November 20, 2010 08:46 by away4m


Initial Code
public static function checkAlias(obj:Object):void {
	var cname:String = getQualifiedClassName(obj);
	cname = cname.split("::").join(".");

	try {
		getClassByAlias(cname)
	} catch (e:Error){
		registerClass(obj);
	}
}

public static function registerClass(cls:*):void {
	var cname:String = getQualifiedClassName(cls);
	var cname_fixed:String = cname.split("::").join(".");

	if (!(cls is Class)){
		cls = getDefinitionByName(cname);
	}

	registerClassAlias(cname_fixed, cls);
}

Initial URL
http://friendfeed.com/away4m

Initial Description

                                

Initial Title
auto register object aliases for remoting

Initial Tags
object, Net

Initial Language
ActionScript 3