roymeo wrote:
>--Strange behavior noticed--
>When I have no mouse---- handlers in the "attached to a sprite
>script" which has an ancestor script, I don't get any messages to
>the mouse---- handlers in the ancestor script. I even made a
>separate movie to test, and if the attached script has a
>mouseUp/Down, then the ancestor gets mouseUp, mouseDown, and
>mouseUpOutside messages. Adding just mouseEnter then also gives me
>mouseEnter/mouseLeave messages. So in order for my toggle button
>script used as an ascestor to get these mouse messages, I need at
>least a mouseDown and a mouseEnter in it which just call the same
>thing in the ancestor.
Below something I wrote on dirgames-l.
Andrew White did some research and noticed that sprite 1 differs from
all other sprites, and will receive the mouse-events even if
mouse-handlers are only located in ancestors.
>Imagine that Director has some kind of cached information as to
>which sprites need to be monitored for mouse-events. If there is a
>behavior with one of the specific mouse-events-handlers attached to
>the sprite, then the _sprite_ will be included in the "to be
>monitored" list. Unfortunately this survey of objects does not reach
>into the ancestor-chain, so a mouse-event-handler must be explicitly
>present in at least one object attached to the sprite, for the
>sprite to receive mouse-events.
>
>This leads to the odd effect, that if you have a mouseUp handler in
>the ancestor, then it will work if there is a mouseDown handler in
>the subObject, attached as behavior, but will be ignored, if the
>subObject contains no mouse-events-handlers.
>Also, the mouseUp handler in the ancestor can be activated, by
>attaching to the sprite, yet another object, which qualifies for
>the survey.
>
>So if there is any object on a sprite, that triggers the mouse-event
>mechanism, then the _sprite_ will receive the events, and as a
>result, any object in the scriptInstanceList, will receive the
>events, and consequently the events will be trapped by the proper
>handlers, no matter how deeply nested in ancestors they may be.
Jakob
[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!]