# Function to create new MC (help!)

**URL:** <https://forum.kirupa.com/t/function-to-create-new-mc-help/318520>\
**Category:** Uncategorized\
**Created:** [January 22, 2011, 6:56pm UTC](https://forum.kirupa.com/t/function-to-create-new-mc-help/318520 "2011-01-22T18:56:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![travisschau](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@travisschau](https://forum.kirupa.com/u/travisschau)\
**Post date:** [January 22, 2011, 6:56pm UTC](https://forum.kirupa.com/t/function-to-create-new-mc-help/318520/1 "2011-01-22T18:56:04Z")

</div>

hi there,  
I’m having trouble. I want to create a function that can create new MCs. I have a movieClip exporting as “Box” in my library, and I want to add an instance to the stage called “box”…

like so:

```auto

function addNewMC (instanceName:String, mcName:MovieClip)
{
    instanceName:mcName = new mcName;
    addChild(instanceName);
}

addNewMC(box, Box);

```

but that does not work! I think it’s something small, but I’m not sure what. I’m going to use this function for a bunch of different MCs, which is why I want it to by dynamic.

If there’s a smarter way to do this… I will!  
Thanks! -Travis
