# Multiple movie with on function

**URL:** <https://forum.kirupa.com/t/multiple-movie-with-on-function/92276>\
**Category:** Uncategorized\
**Created:** [October 15, 2003, 10:50am UTC](https://forum.kirupa.com/t/multiple-movie-with-on-function/92276 "2003-10-15T10:50:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmasterj](https://avatars.discourse-cdn.com/v4/letter/w/e5b9ba/32.png) [@wmasterj](https://forum.kirupa.com/u/wmasterj)\
**Post date:** [October 15, 2003, 10:50am UTC](https://forum.kirupa.com/t/multiple-movie-with-on-function/92276/1 "2003-10-15T10:50:24Z")

</div>

I want to be able to create more than one movie clip with different names. But right now i can only create one named “triangel”. But i want to be able to create multiple movieclips with the ‘string’ which is passed as a parameter.

This is my code now:

[AS]  
\_global.Box = function(string, h, b)  
{  
\_root.createEmptyMovieClip (“triangel”, 1);  
with (\_root.triangel)  
{  
beginFill (0xEEEEEE, 100);  
lineStyle (0.1, 0xBBBBBB, 100);  
moveTo (200, 200);  
lineTo (200, 200+h);  
lineTo (200+b, 200+h);  
lineTo (200+b, 200);  
lineTo (200, 200);  
endFill();  
}  
}

Box(“fet”,200,200);  
Box(“gus”,-100,-100);  
[/AS]

How could I do this?

What i want to know i the \_root.xxx part  
i want to be able to dynamically change that depending on the ‘string’ parameter

thx
