# Script doesn't work whenbuttons are grouped into a Movie Clip

**URL:** <https://forum.kirupa.com/t/script-doesnt-work-whenbuttons-are-grouped-into-a-movie-clip/291134>\
**Category:** flash\
**Created:** [June 25, 2009, 1:58am UTC](https://forum.kirupa.com/t/script-doesnt-work-whenbuttons-are-grouped-into-a-movie-clip/291134 "2009-06-25T01:58:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evergreen481](https://avatars.discourse-cdn.com/v4/letter/e/46a35a/32.png) [@evergreen481](https://forum.kirupa.com/u/evergreen481)\
**Post date:** [June 25, 2009, 1:58am UTC](https://forum.kirupa.com/t/script-doesnt-work-whenbuttons-are-grouped-into-a-movie-clip/291134/1 "2009-06-25T01:58:02Z")

</div>

This Script:

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*; 
var cities:Array = ["muscat", "sohar", "dubai","abu_dhabi"]

function mover (targetX, targetY){
currentX = marker_mc._x;
currentY = marker_mc._y;
var xTween:Tween = new Tween(marker_mc, "_x", Strong.easeOut, currentX, targetX, .5, true);
var yTween:Tween = new Tween(marker_mc, "_y", Back.easeOut, currentY, targetY, 1.5, true); 
} 
for (var i = 0; i<cities.length; i++){ 
*var my_btn = this[cities+"_btn"];
my_btn.myCity = cities;
my_btn.onRollOver = function() {
mover( this._x, this._y); 
marker_mc.gotoAndStop(this.myCity);
}
} 

```

…does not work when the buttons “muscat\_btn”, “sohar\_btn”, “dubai\_btn” and “abu\_dhabi\_btn” are grouped into a movie clip.

Any suggestions?

Thanks :thumb:
