masking following mouse within boundary
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: masking following mouse within boundary

  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    39

    masking following mouse within boundary

    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

  2. #2
    Senior Member
    Join Date
    Sep 2002
    Location
    Texas
    Posts
    348
    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

  3. #3
    Member
    Join Date
    Dec 2002
    Posts
    39

    kismut

    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

  4. #4
    Senior Member
    Join Date
    Sep 2002
    Location
    Texas
    Posts
    348
    first frame:
    Code:
    if (_xmouse>200 & _xmouse<400 & _ymouse>200 & _ymouse<400) {
    	check._x = _xmouse;
    	check._y = _ymouse;
    }
    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.
    i have an example to download if you want.

    aaron
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Dec 2002
    Posts
    39

    thanks

    perfect. exactly the effect that i wanted!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com