# Dynamically adding actionscript to a \_mc

**URL:** https://forum.kirupa.com/t/dynamically-adding-actionscript-to-a--mc/87104
**Category:** Uncategorized
**Created:** [April 18, 2005, 4:07pm UTC](https://forum.kirupa.com/t/dynamically-adding-actionscript-to-a--mc/87104 "2005-04-18T16:07:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cmos](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@cmos](https://forum.kirupa.com/u/cmos)
#### Post date: [April 18, 2005, 4:07pm UTC](https://forum.kirupa.com/t/dynamically-adding-actionscript-to-a--mc/87104/1 "2005-04-18T16:07:55Z")

</div>

I have been able to make as many MC instances as i want using the attachMovie() funciton. e.g.

for (x=1; x\<=10; x++){  
\_root.attachMovie(“box\_mc”,“box”+x+"\_mc",x);  
}

Now lets say i have some actionscript (same code) that i want to add to each instance of that mc … how would i go about doing that without having to actually make each instance manually and add the code?

Any help would be greatly appreciated

thanks
