|
|
|
Pass handler to next Sprite
Added on 10/24/2003
|
Sometimes in Director you may need a sprite to catch an event and then pass the information down to the next sprite that is able to receive it. Adding this to your first sprite lets it send the message to the next relevant sprite for processing. This example uses mouseUp but can be modified to use any handler.
--Copyright 2003 MediaMacros, Inc & Chuck Neal
property spriteNum
on mouseUp me
repeat with x = (spriteNum - 1) down to 1
--check the sprite
if (the mouseLoc).inside(sprite(x).rect) then
sList = sprite(x).scriptInstanceList
if sList.count = 0 then nextRepeat
--check the scripts
repeat with s in sList
h = s.handlers()
if h.getOne(#mouseUp) > 0 then
sendSprite(x, #mouseUp)
exit
end if
end repeat
end if
end repeat
end
|
|