# Refer to multiple mc's with a function?

**URL:** <https://forum.kirupa.com/t/refer-to-multiple-mcs-with-a-function/86579>\
**Category:** Uncategorized\
**Created:** [April 14, 2005, 1:49am UTC](https://forum.kirupa.com/t/refer-to-multiple-mcs-with-a-function/86579 "2005-04-14T01:49:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oekakimaker](https://avatars.discourse-cdn.com/v4/letter/o/9fc348/32.png) [@oekakimaker](https://forum.kirupa.com/u/oekakimaker)\
**Post date:** [April 14, 2005, 1:49am UTC](https://forum.kirupa.com/t/refer-to-multiple-mcs-with-a-function/86579/1 "2005-04-14T01:49:25Z")

</div>

[font=Times New Roman][size=3]I have a function charge(chaser,player){ various code that works…} ; it tells one mc to move toward another, but that’s not important. So, I refer to the actual movie clips when I use the functions, charge(bug,man); It works! So, I put mc’s bug1 and bug2 on the stage. Potentially there will be tons of bugs (the insect, not flaw) and I want them all to follow the rules of the function, without me having to refer to them individually. I tried to use a for loop: for(i=0;i\<3;i++){ charge([“bug”+i],man)  
Didn’t work. Basically I want to know how to apply a single function to multiple movie clips. Any help is appreciated!  
[/size][/font]
