hittest in flash

Out of context: Reply #1

  • Started
  • Last post
  • 2 Responses
  • mac100

    Hi drzoom
    you need to use a shape flag
    hittest
    here is the code
    copy and paste it on the a MC
    with to frames of different colours and pu a stop action on the first frame

    onClipEvent (enterFrame) {
    x = _root._xmouse;
    y = _root._ymouse;
    if (this.hitTest(x, y, true)) {
    gotoAndStop(2);
    } else {
    gotoAndStop(1);
    }
    }
    the true bit is the shape flag that take the shape of the MC not its bounderys

    hope this helps

    mac-10

View thread