Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Jump Sprite - Move a sprite along a parabolic arc so it
ChromeLib
Farbflash.de
Effector Set I for Alphamania
Object Browser
Change Line Direction of a Shape Sprite
Light Up
New bitmap from existing member
Yak
Print Current Marker
 

 

 

Behavior Pass handler to next Sprite

Added on 10/24/2003

 

Compatibilities:
D7 D8 D8_5 D9 Mac PC Shockwave

This item has not yet been rated

Author: MediaMacros (website)

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

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail