# imageMove

**URL:** <https://forum.kirupa.com/t/imagemove/90764>\
**Category:** flash\
**Created:** [May 20, 2005, 2:43pm UTC](https://forum.kirupa.com/t/imagemove/90764 "2005-05-20T14:43:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macro\_design](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Macro\_design](https://forum.kirupa.com/u/Macro_design)\
**Post date:** [May 20, 2005, 2:43pm UTC](https://forum.kirupa.com/t/imagemove/90764/1 "2005-05-20T14:43:21Z")

</div>

Hi,

I’ve been writing some code, that - at the moment - makes an MC move, according to the mouseMove at the stage. But I want it to move, according to the size of another movieClip, and then use that movieClip as mask.

Now, every time I try changing it, it doesn’t work.

Here’s a reference link, to what effect I’m trying to replicate: [www.hugoboss.com](http://www.hugoboss.com) ( look under one of the collections, and press a thumbnail, then move the mouse over to the large image, placed in the right side of the screen ).

Here’s the current code:  
[AS]onClipEvent (enterFrame) {  
speed = 10;  
}  
onClipEvent (enterFrame) {  
var xMove = ((Stage.width))-\_root.\_xmouse;  
\_x += Math.ceil((xMove-\_x)/speed);  
var yMove = ((Stage.height))-\_root.\_ymouse;  
\_y += Math.ceil((yMove-\_y)/speed);  
}[/AS]

Any help, would be much appreciated
