A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Help - basic hittest!

  1. #1
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472
    Hi Guys,

    I want to make a simple hittest but I've forgotten the syntax.

    I want the variable 'solo' to be true on mousedown on an object - not on a button!

    It's goes something like ...

    onClipEvent (mouseDown) {
    if (hitTest( _root._xmouse, _root._ymouse, true));
    solo = true;
    }
    }

    Do I need a 'this' somewhere?

    TIA
    POD

  2. #2
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    That looks fine;
    It should set solo to true when the mouse is clicked while
    over the MC. I notice that you didn't set solo to false beforehand.

  3. #3
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    One other thing because you specified true in hitTest() it will only return true if you click on a filled portion of the MC. For example if your MC contains an unfilled rectangle, then it will only return true if you click on the very edge of the rectangle
    Hope this helps!
    BlinkOk

  4. #4
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472

    dooooooouuuuuu

    Thanks for replying BlinkOk,

    Everything was fine - I mistakenly targeted the variable 'solo' with the wrong path. I got help from a '_parent'

    /POD

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