[AS3.0]TypeSorter Class

To spare some time on saving variables in a structured enviroment, i made this little TypeSorter class.

The static function TypeSorter.sort accepts any variable. It will save the variables and sort them acccording to their data types. TypeSorter.sort will return an structured object with arrays.
———–


USAGE:

var obj:Object = TypeSorter.sort( param1, param2, …params );
trace( obj.numbers ); //reads out the numbers array
trace( obj.strings ); //reads out the strings array
trace( obj.objects.movieclips ); //reads out the movieclips array
trace( obj.objects.sprites ); //reads out the sprites array
trace( obj.defaults ); //reads out the defaults array


SUPPORTED TYPES:

- Number
- String
- Object
- MovieClip
- Sprite
- Array
- Default ( for unsupported types )
———–


TypeSorter Class

View CodeACTIONSCRIPT

Comments are closed.


Categories
Archives
LinkedIn
R. Kollau