The Infinite Menu Tutorial Problem

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 += (distancespeed);
}
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.

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

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.

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.

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.

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 += (distancespeed);
}
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. =)

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

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.

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.

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

The tutorial is here.

http://www.kirupa.com/developer/mx/infinite.htm