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
Bouncing Bevel Light-Alphamania
Behavior Writer
Scale the screen
Shockwave asking for Xtras
TranZtions
Get Key Code
Toggle ImageEnabled Property of a Flash Sprite
FreePPP Control
ADisplay
Runtime Debugging Utilities
 

 

 

Behavior change LocZ

Added on 8/30/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

Rating:

Author: CarolGuo

Whebn you click a sprite in group, the sprite will be on top

--CREATE BY:Carol Guo
--when click a sprite in group, the sprite will be on top

property pStartSpriteNum
property pEndSpriteNum
property pLocZ
property pMySprite

on getPropertyDescriptionList me
  list=[:]
  addProp list,#pStartSpriteNum,[#comment: "First sprite of the group", #format: #integer, #default: 0]
  addProp list,#pEndSpriteNum,[#comment: "Last sprite of the group", #format: #integer, #default: 0]
  return list
end

on getbehaviordescription me
  vDesc = "all sprites use this behavior load into scroe in sequence" & RETURN
  vDesc = vDesc &"when click a sprite in group, the sprite will be on top"
  return vDesc
end

on beginSprite me
  pMySprite = sprite(me.spriteNum)
  pLocZ = pMySprite.locZ
end

on mouseDown me
  tClickLocZ = pLocZ
  repeat with i = pStartSpriteNum to pEndSpriteNum
    case TRUE of
      (sprite(i).pLocZ < tClickLocZ): sprite(i).pLocZ = sprite(i).pLocZ
      (sprite(i).pLocZ = tClickLocZ): sprite(i).pLocZ = pEndSpriteNum
      (sprite(i).pLocZ > tClickLocZ): sprite(i).pLocZ = sprite(i).pLocZ - 1
    end case
    sprite(i).locZ = sprite(i).pLocZ
  end repeat
  updateStage
end

 


Contact

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

Send e-mail