Duplicate

Hello there

I have a class name BigClass and some other classes that extends BigClass named SmallClass1 SmallClass2 etc.

I have an instance called bila of SmallClass1 (or it may be of SmallClass2 etc).
I’ld like to duplicate this instance - like bila2 and bila to refer to same thing,
so bila can follow his normal course of actionscript3(change reference) and bila2 to do some movement (the class extends movieclip).

I tried to use

var bila2:BigClass

and

bila2=bila;
addChild(bila2);

but it seems that does not work, maybe because bila2 = new … does not exist… cause I do not know what instance of which class it is.
I solved this in a copy-paste way… and this… duplicate thing is over 50 lines… :frowning: so… I don’t want to use copy-paste and if statements.

Any sugestions ?

Note that
var bila:BigClass
and after that bila = new SmallClass1(); // it can be SmallClass1 or 2

Thanks