flash hack high five

to this guy

for this hack (my version):

static private function construct(type:Class, args:Array):*
    //OK SO we can't dynamically pass an array in 
    //since this is a constructor and not a Function object...
    //SO instead we're just going to hardwire it for up to N arguments
    //I am so so sorry
    if(!args || args.length == 0)
        return new type();                
            case 1:
                return new type(args[0]);
            case 2:
                return new type(args[0],args[1]);
            case 3:
                return new type(args[0],args[1],args[2]);
            case 4:
                return new type(args[0],args[1],args[2],args[3]);
            case 5:
                return new type(args[0],args[1],args[2],args[3],args[4]);
                throw new Error("Too many Dao Constructor Arguments: if you need more, expand the switch statement I guess. Sigh.");
    return null;

Silent partners in suffering.