on beginsprite me me .findlowersprite() end beginsprite
on mouseup me me .transmitclick() end mouseup
on findlowersprite me nsprite = me . spritenum - 1 rmyrect = sprite ( me . spritenum ). rect pnintersectsprite = 0 repeat with ntest = nsprite down to 1 rtestrect = sprite (ntest). rect rintersect = intersect ( rmyrect, rtestrect ) if rintersect <> rect ( 0 , 0 , 0 , 0 ) then pnintersectsprite = ntest exit repeat end if end repeat end findlowersprite
on transmitclick me if pnintersectsprite <> 0 then sendsprite ( pnintersectsprite, #mouseup ) end if end transmitclick
on beginsprite me me .findlowersprite() end beginsprite
on mouseup me me .transmitevent( #mouseup ) end mouseup
on findlowersprite me nsprite = me . spritenum - 1 rmyrect = sprite ( me . spritenum ). rect pnintersectsprite = 0 repeat with ntest = nsprite down to 1 rtestrect = sprite (ntest). rect rintersect = intersect ( rmyrect, rtestrect ) if rintersect <> rect ( 0 , 0 , 0 , 0 ) then pnintersectsprite = ntest exit repeat end if end repeat end findlowersprite
on transmitevent me , yevent if pnintersectsprite <> 0 then pmousepoint = the mouseloc rtestrect = sprite (pnintersectsprite). rect if pmousepoint. inside ( rtestrect ) then sendsprite ( pnintersectsprite, yevent ) end if end if end transmitevent