# Lostinbeta

**URL:** <https://forum.kirupa.com/t/lostinbeta/12532>\
**Category:** Uncategorized\
**Created:** [February 1, 2003, 7:11am UTC](https://forum.kirupa.com/t/lostinbeta/12532 "2003-02-01T07:11:21Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)\
**Post date:** [February 1, 2003, 7:11am UTC](https://forum.kirupa.com/t/lostinbeta/12532/1 "2003-02-01T07:11:21Z")

</div>

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 + (distance_speed); ;}  
else if(\_root.\_xmouse \> center && this.\_x \< 50 ){  
this.\_x = \_x + (distance_speed); ;}

}

---

<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:** [February 1, 2003, 7:13am UTC](https://forum.kirupa.com/t/lostinbeta/12532/2 "2003-02-01T07:13:37Z")

</div>

Ok, I came up with this…

```php
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?

---

<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:** [February 1, 2003, 7:15am UTC](https://forum.kirupa.com/t/lostinbeta/12532/3 "2003-02-01T07:15:28Z")

</div>

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.

---

<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:** [February 1, 2003, 7:16am UTC](https://forum.kirupa.com/t/lostinbeta/12532/4 "2003-02-01T07:16:28Z")

</div>

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.

---

<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:** [February 1, 2003, 7:21am UTC](https://forum.kirupa.com/t/lostinbeta/12532/5 "2003-02-01T07:21:28Z")

</div>

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.

---

<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:** [February 1, 2003, 7:28am UTC](https://forum.kirupa.com/t/lostinbeta/12532/6 "2003-02-01T07:28:42Z")

</div>

Eh, I am alright…lol.

```php
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 😉

---

<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:** [February 1, 2003, 7:31am UTC](https://forum.kirupa.com/t/lostinbeta/12532/7 "2003-02-01T07:31:35Z")

</div>

wow lost, I checked that flash file…

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

---

<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:** [February 1, 2003, 7:35am UTC](https://forum.kirupa.com/t/lostinbeta/12532/8 "2003-02-01T07:35:26Z")

</div>

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.

---

<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:** [February 1, 2003, 7:35am UTC](https://forum.kirupa.com/t/lostinbeta/12532/9 "2003-02-01T07:35:56Z")

</div>

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

---

<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:** [February 1, 2003, 7:40am UTC](https://forum.kirupa.com/t/lostinbeta/12532/10 "2003-02-01T07:40:05Z")

</div>

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.

---

<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:** [February 1, 2003, 7:41am UTC](https://forum.kirupa.com/t/lostinbeta/12532/11 "2003-02-01T07:41:41Z")

</div>

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;

😉

---

<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:** [February 1, 2003, 7:51am UTC](https://forum.kirupa.com/t/lostinbeta/12532/12 "2003-02-01T07:51:02Z")

</div>

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

---

<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:** [February 1, 2003, 7:59am UTC](https://forum.kirupa.com/t/lostinbeta/12532/13 "2003-02-01T07:59:12Z")

</div>

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.

---

<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:** [February 1, 2003, 8:02am UTC](https://forum.kirupa.com/t/lostinbeta/12532/14 "2003-02-01T08:02:35Z")

</div>

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 😉

But no problem man, I am here to help 😉

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