# Mouse Position Controls Movie Clips?

**URL:** <https://forum.kirupa.com/t/mouse-position-controls-movie-clips/304481>\
**Category:** flash\
**Created:** [February 8, 2010, 6:02pm UTC](https://forum.kirupa.com/t/mouse-position-controls-movie-clips/304481 "2010-02-08T18:02:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bradg19](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@Bradg19](https://forum.kirupa.com/u/Bradg19)\
**Post date:** [February 8, 2010, 6:02pm UTC](https://forum.kirupa.com/t/mouse-position-controls-movie-clips/304481/1 "2010-02-08T18:02:23Z")

</div>

Just had a quick question, I’m just having a little trouble with this photo gallery.  
I want the thumbnails to slide based on where the mouse is on the screen.  
Does this seem like the best approach?  
I can get the thumbnails to slide but they slide when the mouse enters the area and then is moved out of the area. Instead of just when the mouse is in the area. Any idea why this would happen?

Here is the event listener that controls the moveRow function.

stage.addEventListener(Event.ENTER\_FRAME, moveRow);

public function moveRow(evt:Event):void {  
if (galleryCheck == true){  
}else{  
if(mouseY \>= 570 && mouseY \<= 635 && mouseX \>= 622 && mouseX \<= 917){  
for (var i:Number=0; i\<imageCount.length; i++) {  
TweenLite.to(slideThumbs\* as MovieClip, 50, {x:(imageCount.length \* thumbnailSpacing)_(-1)});  
}  
trace(“Slide Left”);  
}else if(mouseY \>= 570 && mouseY \<= 635 && mouseX \>= 5 && mouseX \<= 300){  
for (var i:Number=0; i\<imageCount.length; i++) {  
TweenLite.to(slideThumbs_ as MovieClip, 50, {x:(imageCount.length \* thumbnailSpacing)});  
}  
trace(“Slide Right”);  
}  
}  
}

Thanks,  
Brad
