how can i instantiate another class object from a class instance?
in the code below (which doesn't work) i'd like the function to return a new class instance based the passed argument's class. in other words, i want the function to return a new instance of MySprite without having to call new MySprite();.
var mySprite:Sprite = new MySprite();
var anotherSprite:Sprite = makeAnotherSprite(mySprite);
function makeAnotherSprite(instance:Sprite):Sprite
{
return new getDefinitionByName(getQualifiedClassName(instance));
}