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?

Était-ce utile?

La 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);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top