# The Infinite Menu Tutorial Problem

**URL:** https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612
**Category:** flash
**Created:** [March 16, 2003, 4:50am UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612 "2003-03-16T04:50:43Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![zcarrington1](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zcarrington1](https://forum.kirupa.com/u/zcarrington1)
#### Post date: [March 16, 2003, 4:50am UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/1 "2003-03-16T04:50:43Z")

</div>

I’ve created an infinite menu for my site based on the Kirupa tutorial. However, when the menu scrolls past the specified points in the actionScript, it appears to “jump” back to the beginning of the menu. It doesn’t look like it is continuoulsy scrolling. Does anyone know what I’m doing wrong?

Here is the action script:

onClipEvent (load) {  
xcenter = 540;  
speed = 1/130;  
}  
onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x += (distance_speed);  
}  
onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x += (distance_speed);  
if (\_x\>288.4) {  
\_x = -750;  
}  
if (\_x\<-750) {  
\_x = 288.4;  
}  
}

I’ve also included the file for download.

---

<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 16, 2003, 4:55am UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/2 "2003-03-16T04:55:44Z")

</div>

I already answered your question on your other post, did you even bother to check it? Please don’t post multiple threads on the same subject.

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17488](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=17488)

---

<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 16, 2003, 4:15pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/3 "2003-03-16T16:15:31Z")

</div>

It’s not the same question. In the last post I asked how to slow it down. In this one I asked why it appears to jump and how I can fix that.

---

<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 16, 2003, 9:19pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/4 "2003-03-16T21:19:24Z")

</div>

oh haha my bad, I just noticed the same script posted and thought it was the same question. I apoligize. =)

I went ahead and fixed your gallery, some of your numbers were a bit off and I had to adjust 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 16, 2003, 9:36pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/5 "2003-03-16T21:36:50Z")

</div>

Thanks, electrongeek. I see the changes in the action script. If you have a moment, could you please explain why you made the changes? I’m trying to understand what I did wrong. Thanks again.

---

<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 16, 2003, 9:43pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/6 "2003-03-16T21:43:15Z")

</div>

Sure, I’ll try to explain it. This is the new script after my adjustments.[AS]onClipEvent (load) {  
xcenter = 400;  
speed = 1/130;  
}  
onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x += (distance_speed);  
}  
onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x += (distance_speed);  
if (\_x\>0) {  
\_x = -616;  
}  
if (\_x\<-616) {  
\_x = 0;  
}  
}[/AS]  
The 400 change on the xcenter basically determine how the menu is going to scroll left or right relative to the mouse position. That was just a minor change from your 540 which wasn’t the problem why there was a jump.

The cause of the jump was where I placed 616, which is the width of your menu or the width of the MC that holds those images. It was more like 615.9 so I rounded it up to 616. I forgot what you had there before, but it was way off.

I also had to go inside the menu and nudge it to the right to compensate for the new numbers as well.

So basically you stated the wrong width so things were all screwy. I hope that clears things up. =)

---

<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 16, 2003, 10:09pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/7 "2003-03-16T22:09:56Z")

</div>

Ahhhh I see. Where you put the widthe of the MC I put the width of the stage. That explains it. Thanks.

---

<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 16, 2003, 10:25pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/8 "2003-03-16T22:25:55Z")

</div>

Ohhhhhhhh K. Electron geek, I’m sure you can field this one. Now I am trying to make so clicking on a pic brings up info on the site. Each pic has an instance name and the movie clip I want to manipulate has one too. I put the following code on frame two of the main time line but it does not work.

hifivemom.onRelease = function() {  
infobox.gotoAndPlay(45);  
};

I’ve included the file below. hifivemom is the button with the womans face and infobox is directly below the menu, under project details.

---

<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 16, 2003, 10:49pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/9 "2003-03-16T22:49:01Z")

</div>

That function isn’t going to work since you nested your buttons in several movieclips so what I did was apply this to your “hifivemom” button itself:[AS]on (release) {  
\_root.infobox.gotoAndPlay(45);  
}[/AS]

You’ll have to do the same to the rest of the buttons. I attached your file again.

---

<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: [June 4, 2003, 7:03pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/10 "2003-06-04T19:03:54Z")

</div>

how would i go about making this thing scroll vertically?

just change all the “x’s” to “y’s”?

also, where is this tutorial at?

kasey

---

<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: [June 4, 2003, 8:11pm UTC](https://forum.kirupa.com/t/the-infinite-menu-tutorial-problem/15612/11 "2003-06-04T20:11:56Z")

</div>

The tutorial is here.

[http://www.kirupa.com/developer/mx/infinite.htm](http://www.kirupa.com/developer/mx/infinite.htm)
