# Duplicate

**URL:** <https://forum.kirupa.com/t/duplicate/302081>\
**Category:** Uncategorized\
**Created:** [December 21, 2009, 4:49pm UTC](https://forum.kirupa.com/t/duplicate/302081 "2009-12-21T16:49:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindtricks1](https://avatars.discourse-cdn.com/v4/letter/m/b3f665/32.png) [@mindtricks1](https://forum.kirupa.com/u/mindtricks1)\
**Post date:** [December 21, 2009, 4:49pm UTC](https://forum.kirupa.com/t/duplicate/302081/1 "2009-12-21T16:49:46Z")

</div>

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… ☹ 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
