# Mouse position controls speed of sliding horiz. pictures

**URL:** <https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809>\
**Category:** flash\
**Created:** [April 3, 2002, 3:08pm UTC](https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809 "2002-04-03T15:08:49Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [April 3, 2002, 3:08pm UTC](https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809/1 "2002-04-03T15:08:49Z")

</div>

Trying to create (and learn) an effect I see often where a series of photos (side-by-side) will scroll across and when your mouse draws nearer to the centerpoint it slows down enough to be able to click on it. Any one know how to do 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:** [April 3, 2002, 3:38pm UTC](https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809/2 "2002-04-03T15:38:28Z")

</div>

sure\r//this action is within the scrolling pictures (a movieclip instance):\r\ronClipEvent(load) {\rxCen = 550/2; //if movie width is 550, change otherwise\r}\ronClipEvent(enterFrame) {\rx = xCen-\_root.\_xmouse;\r\_x -= x; //reverse direction of mouse:\r//mouse go left, pic goes right, vice versa\r}

---

<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:** [April 3, 2002, 4:40pm UTC](https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809/3 "2002-04-03T16:40:43Z")

</div>

Thanks for the reply. Let me see if I have it. In the MC I create a series of pictures side-by-side in one frame, drag the clip onto my stage and assign the actionscript to it.

---

<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:** [April 6, 2002, 3:47am UTC](https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809/4 "2002-04-06T03:47:11Z")

</div>

I would be lying if I said that that code worked b’cuz it didn’t. Instead of letting the image scroll against the movement of the mous (horizontally) all it did was let the image scroll across the screen. Is there anything i’m missing. Could you give FULL instructions how to do it. like the one at [www.linkinpark.com](http://www.linkinpark.com) if you enter the flash web site. I like that effect.

---

<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:** [April 6, 2002, 11:42am UTC](https://forum.kirupa.com/t/mouse-position-controls-speed-of-sliding-horiz-pictures/2809/5 "2002-04-06T11:42:14Z")

</div>

Draw a square in your scene, select it with the black arrow tool, press F8, choose movie clip, then open the actionsctipt panel of the square and enter the code. It will work.\r\rpom 0] \rNote : I suggest you do \_x = -x/25 to see anything.
