Type Switch Alternative

Hi guys,
I have a very simple and generic problem I would like to solve but I can’t seem to find a good solution.

Basically, I have a class with a method that takes a string as parameter. This string define the type of the object created by the method. Somewhat like so:

 
public static const TYPE_A:String = "type_a";
public static const TYPE_B:String = "type_b";
 
private var _type:IType;
 
public function setType(type:String):void
{
    switch(type){
        case TYPE_A :
             _type = new TypeA();
            break;
        case TYPE_B :
            _type = new TypeB();
           break;
       default :
           throw new ArgumentError("Invalid Type");
 
   }
}

As you can see, It not really scalable because each time I add a new type, I must modify this class’s code. Is there any other ways to do this kind of thing?

Thanks!