Mouse detected scrolling interface

[font=verdana, arial, helvetica][size=2]Using this script to provide a auto scrolling interface. Need an area in the center that does not scroll. Also wanted to add the _ymouse scroll too.

onClipEvent (enterFrame) {
shift = ((400-_root._xmouse)/20);
if (((this._x>=1300) && (shift>0)) || ((this._x<=-500) && (shift<0))) {
shift = 0;
}
this._x = this._x+shift;
[/size][/font]

ok because of the way it is calculated… there is one way to do it without changing its calculation… at least one way i can see how you could do it anyway…

shift = ((400-_root._xmouse)/20)
if(shift >=-2 && shift <=2){
	shift = 0
}
if(shift>2){
	shift -=2
}
if(shift<-2){
	shift +=2
}

replace the line

shift = ((400-_root._xmouse)/20)

with what i have above and you should be home free as they say :wink:

note that my code will give you an x area of 4 that equates to 0… play with the numbers as you like… for the y simply use this:

Yshift = ((400-_root._ymouse)/20)
if(Yshift >=-2 && Yshift <=2){
	Yshift = 0
}
if(Yshift>2){
	Yshift -=2
}
if(Yshift<-2){
	Yshift +=2
}
if (((this._y>=1300) && (Yshift>0)) || ((this._y<=-500) && (Yshift<0))) {
	Yshift = 0;
}
this._y = this._y+Yshift

again play with the numbers as is fitting to you…

i also strongly reccomend changing the name of the variable shift (used in the x calculations) to something else like Xshift not only is it more descriptive and easier to identify but also shift is a flash keyword (used in arrays) and as such it might get a bit confusing if you get irrelevant code hints as flash is thinking you are trying to play around with an array and so on and so forth…

enjoy anyway :wink:

Prophet.

Thanks for your quick response. I could not get this to work. I have no skill in programming. Can you write the whole script with the onClipEvent so I can paste the complete code and not screw it up, you know, idiot proof. I also need some script to keep both shift actions from happening at the same time.

What I am tryig to do is scroll my page content by making movie clip, I need the majority of the page to not scroll so visitors can select items without the page moving. Run there mouse to the edge and it scrolls. But what about smaller screen resolutions. The working area should be what size? I also want the top 150 px on the page for my header, so no scrolling when the mouse is there either. I could send you my file. If you know any other way to get the same results, lets do it.

Can I please pay you?

samyoue@gmail.com

give me absolute full descriptions of what you want (and illustrations if poss - sometimes i can be a little thick when it comes to design etc lol)

happy to help u :slight_smile:

Prophet.