# Gallery moves all the time

**URL:** <https://forum.kirupa.com/t/gallery-moves-all-the-time/16683>\
**Category:** Uncategorized\
**Created:** [March 27, 2003, 1:08pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683 "2003-03-27T13:08:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cello](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@Cello](https://forum.kirupa.com/u/Cello)\
**Post date:** [March 27, 2003, 1:08pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/1 "2003-03-27T13:08:43Z")

</div>

…and I don’t want it to!

Have a look at [http://www.betsytaylor.co.uk/test/gallery.html](http://www.betsytaylor.co.uk/test/gallery.html) - you’ll see that the gallery moves all the time, at whatever speed it is left at.

I’d love it be paused when first landing at the page, either scrolling over a hotspot or entering the mask to make it scroll and stops moving when the area is exited.

Any ideas?

Cello

PS Thanks to Guig0 for the initial idea of using the ‘Infinte Menu’ as a gallery - works well!

---

<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:** [March 27, 2003, 4:44pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/2 "2003-03-27T16:44:25Z")

</div>

Allign it in your movie with the location it wants to stop at. That way when it loads it will show up in that same place at first, and wont need to move

---

<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:** [March 27, 2003, 4:46pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/3 "2003-03-27T16:46:15Z")

</div>

Oh I see it just keeps going and going and going… Hum, lemmy go look at the code in that tutorial

---

<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:** [March 27, 2003, 4:52pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/4 "2003-03-27T16:52:32Z")

</div>

Morse - you’re right and that’s what I did (but didn’t make it very clear from my original post!).

You’ll see that whenever that mouse moves to left or right of centre line in the scene that the bottom gallery starts to scroll. I imagine most users might find this distracting or confusing.

So, ideally the gallery stays still until the mouse is in the active area of the mask. And when the mouse leaves mask the gallery eases to a stop.

This is the code that does the work:

```php
onClipEvent (load)
{
   xcenter=266;
   speed=1/100;
}
onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x-=(distance*speed);
}
onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x-=(distance*speed);
   if (_x > 0) _x=-518;
   if (_x < -518) _x=0;
}

```

It just needs a little refining to get to what I want it to be - any suggestions would be really appreciated.

Cello

Edited to apologise for cross-posting :sigh:

---

<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:** [March 27, 2003, 5:04pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/5 "2003-03-27T17:04:36Z")

</div>

Ah yes, I just found it here: [http://www.kirupa.com/developer/mx/infinite.htm](http://www.kirupa.com/developer/mx/infinite.htm)

Its written by pom, and hes realllllly good.

You could always make the entire thing into a new movie clip and put it in the second frame. In the first frame have stop() and then on(rollOver){gotoAndStop(2)}  
I dunno if that would work. It might. Have just the images in the first frame and then all that code with the images in another mc in the second, if you know what i mean.

---

<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:** [March 27, 2003, 5:52pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/6 "2003-03-27T17:52:12Z")

</div>

I dont know if that would work, just an idea. Does 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:** [March 28, 2003, 4:34am UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/7 "2003-03-28T04:34:22Z")

</div>

```php

onClipEvent (load) {
   xcenter=266;
   speed=1/100;
}
onClipEvent (enterFrame) {
	if(_ymouse>200 & _ymouse<300) {
  	 var distance=_root._xmouse-xcenter;
  	 _x-=(distance*speed);
	}
}
onClipEvent (enterFrame) {
	if(_ymouse>200 & _ymouse<300) {
  		var distance=_root._xmouse-xcenter;
  	 	_x-=(distance*speed);
	}
  	if (_x > 0) _x=-518;
  	if (_x < -518) _x=0;
}

```

edit the “200” and “300” values for the top of your taget area and 300 for the bottom of it.

sry it dosnt glide to a end :-/

---

<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:** [March 28, 2003, 10:03am UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/8 "2003-03-28T10:03:40Z")

</div>

Thx for your replies. Unfortunately one has no effect at all (gallery still speeds on) and with \_ymouse method stops the gallery moving completely!

Any further thoughts? All replies appreciated.

Cello

---

<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:** [March 28, 2003, 7:05pm UTC](https://forum.kirupa.com/t/gallery-moves-all-the-time/16683/9 "2003-03-28T19:05:52Z")

</div>

Hi

I had the exact same problem with one of my projects earlier on… What I ended up doing was moving the entire scene (gallery in your case) into a completely separate .swf and then load it in through loadMovieNum (“gallery.swf”, #), and that way when the mouse is not in that area, it will be out of the .swf and therefore the mouse movements will not correspond…

so…thats one way of doing it…

Let me know if this works for you, and also if you do find the “correct” way of doing it…

good luck
