# Dynamically creating instance of extended MovieClip class

**URL:** <https://forum.kirupa.com/t/dynamically-creating-instance-of-extended-movieclip-class/206208>\
**Category:** Uncategorized\
**Created:** [November 6, 2006, 5:18am UTC](https://forum.kirupa.com/t/dynamically-creating-instance-of-extended-movieclip-class/206208 "2006-11-06T05:18:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarvagya](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@sarvagya](https://forum.kirupa.com/u/sarvagya)\
**Post date:** [November 6, 2006, 5:18am UTC](https://forum.kirupa.com/t/dynamically-creating-instance-of-extended-movieclip-class/206208/1 "2006-11-06T05:18:54Z")

</div>

Hi all,  
I have recently started out with flash oop concepts and was wondering how to do create an instance of an extended movie class without dragging and dropping the clip from the library …  
I have figured out this method…  
for(i = 0;i\<100;i++)  
{var mc:MovieClip = attachMovie(“ball”,“dasd”+i,\_root.getNextHighestDepth());  
mc.\_x = Math.random() \* 600;  
mc.\_y = Math.random() \* 600;  
}  
but this way I cant pass arguments to the constructor function of the ball class…  
any help would be highly appreciated  
regards  
Sarvagya
