> --sprite behavior (attached to standard button)
> on mouseEnter
>    PUT "In Slava's mouseEnter"
>    pass
> end

> on mouseEnter me
>    PUT "In mouseEnter of Sean's button."
>    pMouseWithin = true
>    pass
> end mouseEnter
>
> on exitFrame me
>    if rollOver(me.spriteNum) then
>      if not pMouseWithin then
>        mouseEnter(me)
>      else
>        mouseWithin(me)
>      end if
>    else
>      if pMouseWithin then
>        mouseLeave(me)
>      end if
>    end if
> end exitFrame

So, the behaviors containing both of these mouseEnter handlers is attached
to the same button. One gets the message, the other doesn't. Is that right
so far?

The reason mine does is because I explicitly send it the message from within
the exitFrame handler. Yours doesn't for the same reason it originally
didn't - and I still don't know why that is, I just implemented a
work-around. Pass isn't working for the same reason the automatically
generated mouseEnter message isn't making it through.

Convoluted approach:
1). check if the behavior is running in a MIAW (the activeWindow <> (the
stage))
2). if you need the mouseEnter message to be passed to more than one
behavior per sprite, either use the same approach - the exitFrame handler
triggering the mouseEnter handler, or
3). when one of the mouseEnter handlers fires, do a call to the
scriptInstanceList of the current sprite and send the behavior's reference
as an argument. Check the parameter in the mouseEnter handler and if me <>
passedRef then run the handler.

Usual lingo hoop-jumping.

Also, your mouseEnter handler doesn't declare 'me' as a parameter. It should
explicitly do so. It's not a cast-member script, is it?

HTH,
-Sean.


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to