This behavior uses the LocZ property to move the clicked sprite to the top of other sprites using the behavior. This works well with puzzles, drag behaviors, cards, etc.
--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know. :-)
property spriteNum
global topSprite
on beginSprite me
if topSprite = void then topSprite = spriteNum
if topSprite < spriteNum then topSprite = spriteNum
end
on endSprite me
sprite(spriteNum).locZ = spriteNum
end
on mouseDown me
topSprite = topSprite + 1
sprite(spriteNum).locZ = topSprite
end
on getPropertyDescriptionList me
return "This behavior uses the LocZ property to move the clicked sprite to the top of other sprites using the behavior. This works well with puzzles, drag behaviors, cards, etc."
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA