Question

I'm using registerClassAlias to save custom classes into SharedObject but it's giving me a headache since every time you make a new class, you have to write registerClassAlias sentence and there are hundreds of custom classes to save in my project.

Is there any way to lessen the labor or do you have to write registerClassAlias manually each time you make a class you want to save?

Was it helpful?

Solution

You can lessen the labor by using an array of classes, which still has to be filled manually.

var classArray:Array=[OneClass,TwoClass]; // fill elsewhere
for each(var c:Class in classArray) registerClassAlias(getQualifiedClassName(c),c);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top