I have a mask that follows my mouse. I want the mask happen only when I am mousing in a defined area within my swf.
What is the best way to do this?
Thanks, Reid
Printable View
I have a mask that follows my mouse. I want the mask happen only when I am mousing in a defined area within my swf.
What is the best way to do this?
Thanks, Reid
if you are using startDrag you could use this
StartDrag(Whatever,true,l,t,r,b)
left, top, right, bottom Values relative to the coordinates of the movie clip's parent that specify a constraint rectangle for the movie clip. These parameters are optional.
check the actionscript dictionary
Thanks.
The problem that I have with that is the mask stops following the mouse outside of those specified boundaries, BUT it still tracks it from within the boundary.
EX. If my mouse is outside of the startdrag area, and I move my mouse horizontally, the mask tracks back and forth below within the defined area.
Reid
first frame:
where 200 and 400 are you wanted boundaries and check is your instance name. and in your second frame just put a frame there to keep updating the actions.Code:if (_xmouse>200 & _xmouse<400 & _ymouse>200 & _ymouse<400) {
check._x = _xmouse;
check._y = _ymouse;
}
i have an example to download if you want.
aaron
perfect. exactly the effect that i wanted!