Mouse follow _x,_y limits

im totally new here. Hi !~~

heres my prob:

u know how, with startDrag u can specify left, top, rgt, bottom

values to restrict the mouse movement?

well, i wanna do the same to a mouse follower,…

any ideas?

im usin this code:

_root.follower._x+=(_root._xmouse-_x)*.3

thnx tons,

hog.

just set the limits for the mouse:

if((_xmouse <= 990) && (_xmouse>=0) {
_root.mousebutton._x = _xmouse;
}

and same thing for y. good luck :slight_smile:

thnx MTsoul,

still wont work,

do i have the code right?

onClipEvent(enterFrame){
_root.follower._x+=(_root._xmouse-_x)*.2
if((_xmouse <= 300) && (_xmouse>=100)) {
_root.mousebutton._x = _xmouse;
}
}

oops i meant:

onClipEvent(enterFrame){
_root.sl2._x+=(_root._xmouse-_x)*.2
if((_xmouse <= 300) && (_xmouse>=100)) {
_root.follower._x = _xmouse;
}
}

it kinda works now but it keeps runnin between the loc. of the
current mouse and some loc. in the mc

thnx

not quite sure what you mean by loc. can you show me your swf?

sorry 4 some reason, i couldnt log in

here it is

thnx in advance 4 ur help

um…
the fact that you are using that slowing down thing makes it hard to flash to carry the object to the border you want (in your case, 300). anyway, it probably will be like that.
now you just have to make the y axis, with the same logic. just change all the x’s to y’s and change the border for it.

good job :thumb:

edit that’s what i do :slight_smile: