# How do you make a picture move on rollover

**URL:** https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083
**Category:** flash
**Created:** [August 21, 2003, 11:02pm UTC](https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083 "2003-08-21T23:02:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)
#### Post date: [August 21, 2003, 11:02pm UTC](https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083/1 "2003-08-21T23:02:35Z")

</div>

Hi, i am having a problem, I have a picture that appears from the left, and then a set of buttons from the right, when the user rolls over a button, i want the picture to move left. Would anyone know how i would go about doing this?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 22, 2003, 12:10am UTC](https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083/2 "2003-08-22T00:10:53Z")

</div>

of course !

you’ve got multiple choices here…

simplest one:  
make a movie clip of your image going left to right (or however you want it) and on the first frame of that movie clip write

```auto

stop();

```

do the same thing at the end of the movie clip so it doesnt go back to the beginning  
you can use easing to, to make the image look like it slows down

let’s say that movieclip is called TheMovieClip and is on the top level (its path is \_root.TheMovieClip)

your buttons should be coded like this:

```auto

on(release){
_root.TheMovieClip.play()
}

```

ok now a bit more complicated:

you have the image, still a movie clip but not animated, I’ll call it NotAnimated, its path is \_root.NotAnimated

this is what the coding of the button should look like:

```auto

on(release){
for(i,i<101,i++){
_root.NotAnimated._x += i*5;
}
}

```

now i’d go for the simpler version because the more complicated one means that you have to calculate how far it should go… (here it goes 5\*100 = 500 pixels right from its original position)

hope it helped…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 22, 2003, 12:15am UTC](https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083/3 "2003-08-22T00:15:44Z")

</div>

okay, i think u didn’t quite get what i meant. Okay

the image comes in from left to right , and it is now sitting in the middle of the screen.

when the user rolls over a button, the image goes to the left, (where it came from), to allow room for some text that i want to put.

I can’t think of a way to do it, u probably know.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 22, 2003, 12:35am UTC](https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083/4 "2003-08-22T00:35:33Z")

</div>

how did you make it come left to right ?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 22, 2003, 12:52am UTC](https://forum.kirupa.com/t/how-do-you-make-a-picture-move-on-rollover/29083/5 "2003-08-22T00:52:26Z")

</div>

I just tweened the image from left to right inside a movie clip, what i want is , when the user rolls over a button, for the image to go back to where it came from!
