# 2 week newbie:- moving an image on rollover

**URL:** <https://forum.kirupa.com/t/2-week-newbie-moving-an-image-on-rollover/250772>\
**Category:** flash\
**Created:** [February 1, 2008, 10:05am UTC](https://forum.kirupa.com/t/2-week-newbie-moving-an-image-on-rollover/250772 "2008-02-01T10:05:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellabop](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@hellabop](https://forum.kirupa.com/u/hellabop)\
**Post date:** [February 1, 2008, 10:05am UTC](https://forum.kirupa.com/t/2-week-newbie-moving-an-image-on-rollover/250772/1 "2008-02-01T10:05:25Z")

</div>

Hi - i’m really new to this.

All I want to do is move an image a pixel at a time to the left on rollover on a button.

This is my script so far:

on (rollOver) {  
background.\_x = background.\_x -=1;  
}

This only moves it once then you have to take mouse off then rollover again to move again

What i’d like to incorporate is a loop so ( **only** whilst the mouse is over the button) the image keeps moving to a maximum of 300 pixels then it can’t move any more ( unless the right button has mouse over )

Help / advice, really appreciated. I’ve searched and searched and can’t find this basic procedure anywhere… ☹
