I'm in the process of making one of those nice image scrollers that you see all over the place, but am having a bit of trouble with the mouse co-ordinates.
Basically, I can get the X position working, just about, but the Y position is a mystery to me. I want the scroll to only occur when the mouse pointer is within the confines of the menu, not at any point on the screen as is currently the case.
Here's the troublesome code...
xm = 0;
//function to set the xpos of the movieclip
function xpos(bar_length,mul)
{
hpos = 0;
scroll_length = 840;
incr = bar_length/scroll_length;
xm = _xmouse;
if(_xmouse <= 10){xm = 10;}
if(_xmouse >= 450){xm = 450;}
scroll_x = hpos - xm;
scroll_x = scroll_x * mul;
x_pos = scroll_x * incr;
x_pos = x_pos + hpos;
return x_pos;
}
onEnterFrame = function ()
{
// call function xpos
x_pos = xpos(950,.70);
with (scroller)
{
_x += (x_pos - _x)*.4;
}