# Controlling multiple movie clip location using single function

**URL:** <https://forum.kirupa.com/t/controlling-multiple-movie-clip-location-using-single-function/239295>\
**Category:** flash\
**Created:** [September 20, 2007, 9:17am UTC](https://forum.kirupa.com/t/controlling-multiple-movie-clip-location-using-single-function/239295 "2007-09-20T09:17:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaji](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shaji](https://forum.kirupa.com/u/shaji)\
**Post date:** [September 20, 2007, 9:17am UTC](https://forum.kirupa.com/t/controlling-multiple-movie-clip-location-using-single-function/239295/1 "2007-09-20T09:17:53Z")

</div>

I need to write a function which should fix the location of the movie clip on the stage.

public function setCoOrdinates(xpos:Number,ypos:Number,movieName:String):Void  
{  
eval(movieName).\_x=xpos;  
eval(movieName).\_y=ypos;  
}

My function is as above. While I use this function in flash I only see the last movieclip on the stage which was passed. Movieclips passed earlier seem to have disappeared from the screen.

```
    setCoOrdinates(20,200,"bButton_mc");
    setCoOrdinates(530,100,"fButton_mc");

```

I see only “fButton\_mc” on the stage. Even though I set different xpos and yposs for the movie clip.
