Lostinbeta

I deleted that old thread,

The code, and the file again.

onClipEvent (load) {
center = 250;
speed = 1/10;

}

onClipEvent (enterFrame) {

distance = _root._xmouse - center;

if (_root._xmouse < center && this._x > -50 ){
this._x = _x + (distancespeed); ;}
else if(_root._xmouse > center && this._x < 50 ){
this._x = _x + (distance
speed); ;}

}

Ok, I came up with this…

onClipEvent (load) {
	xcenter = 250;
	speed = 1/10;
	lowX = 50;
	highX = lowX-(this._width-_root.box._width);
}
onClipEvent (enterFrame) {
	var distance = _root._xmouse-xcenter;
	_x += (distance*speed);
	if (this._x>=lowX) {
		this._x = lowX;
	} else if (this._x<=highX) {
		this._x = highX;
	}
}

Check the attachment.

Any help?

If you move the mouse a little from center.
It scrolls slowly then stops right on the edge.

If you move the mouse a lot from center.
It scrolls fast then doesnt stop right on the edge.

the if() should stop it when _x gets to the edge.

if its going scrolling slow it works.
if its scrolling fast there is like a time delay, by the time it stops it has gone past the edge.

I dont know enough about flash to know why it might be doing this.

With the .fla I posted it always stops on the edge. I have moved it fast and never experienced it not stopping on the edge.

Your Good,
Your very Good

aww your Good

Had a look at your file it seems to work perfect. Now I just have to try and understand the code.

Thanks a mil.

Eh, I am alright…lol.

onClipEvent (load) {
	xcenter = 250;
	speed = 1/10;
	lowX = 50;
	highX = lowX-(this._width-_root.box._width);
}
onClipEvent (enterFrame) {
	var distance = _root._xmouse-xcenter;
	_x += (distance*speed);
	if (this._x>=lowX) {
		this._x = lowX;
	} else if (this._x<=highX) {
		this._x = highX;
	}
}

xcenter and speed you know from the infinite menu tutorial you originally got the code from.

lowX is the furthest right your slide clip can move highX is the furthest left your slide clip can go.

lowX is just a number, not that hard.

highX makes it more dynamic to the width so it can be any size you want. It takes the width of this clip, and subtracts the width of the mask so that the distance it can go left is all dynamic so you don’t have to guess and check, it should always work as long as you keep your registration to the far left of the slide clip like you have now.

distance you should know from the tutorial.

if (this._x>=lowX) {
this._x = lowX;
}

If it is out of bounds of the lowX, then keep it in the lowX

else if (this._x<=highX) {
this._x = highX;
}
Else if it is out of bounds of the highX, keep it in the highX.

Any questions just ask :wink:

wow lost, I checked that flash file…

the chartuese and blue really…erm…makes a nice, er…pair of colors.

LOL. Well I adapted it from the original example .fla.

And I assume it is just a test .fla file so I didn’t worry about color. The setup and code is all that matters in this case.

But yes… yuk.

highX = lowX - (this._width - _root.box._width);

once I had it working, I was going to try and do the above.

depending on how lucky I was, it may have taken me 30min or 3 hours to get it right.

And I may have just ended up posting a question on how to get it to wrok.

YOUR GOOD
YOUR VERY GOOD
AWW YOUR GOOD

LOL, I actually stumbled on that by accident. I didn’t feel like coming up with a set number by guess and check so I tried to figure out the relation between the mask and the slide clip and how to get that to work according with the lowX coordinate.

I tried that and it worked. Just got lucky really.

Hmmm, looking at how your registration points are set up (both on the far left side of the clip) you can easily change lowX to be dynamic too…

lowX = _root.box._x;

:wink:

That 9000th post was really cool lost…
What’s next with you? I can’t wait!

I have stuffed around with a lot of scrolling menu tutes…

The infinte slider has the problem of what if your showing 4 items of 5. It looks stupid scrolling the same thing over and over.

Plus none of the tutes explained how to make them work once you have changed the Document size, or moved it around, or changed the sizes.

I wanted the menu that YOU have created, I wanted to make it dynamic wich thanks to _root.box._x; it is now 100% dynamic.
even a newbie can copy and paste this, change the sizes of things move things around and its still gonna work.

I think a tute should be posted on this one… I have been unable to find one on anything like it any site. And personaly I think its the best menu setup around.

thanks again.

Hmmm, perhaps I will bring this up with Kirupa. He might let me make an addition to Ilyas’ Infinite Menu tutorial which would be where it isn’t infinite, but it moves the same.

But trust me… even a n00b can mess this up. We have had n00bs mess up motion tweens…lol.

Most likely it would be a registration point problem. The equations used in your .fla rely on that registration clip being set to any of the 3 far left points. Remember that for future reference :wink:

But no problem man, I am here to help :wink:

Oh… and WOO HOO… MY LAST POST MARKS 9000 POSTS!!!