home *** CD-ROM | disk | FTP | other *** search
/ Eidos Interactive CD-ROM 1997 / EIDOS.ISO / data / apache.dxr / 00005_ButtonControl.ls < prev    next >
Encoding:
Text File  |  1997-10-27  |  2.1 KB  |  59 lines

  1. property ImageUp, ImageRoll, ImageDown, Clicked
  2.  
  3. on mouseEnter me
  4.   if the Clicked of me then
  5.     if the mouseDown then
  6.       set the member of sprite the spriteNum of me to the ImageDown of me
  7.     else
  8.       set the member of sprite the spriteNum of me to the ImageRoll of me
  9.     end if
  10.   else
  11.     set the member of sprite the spriteNum of me to the ImageRoll of me
  12.   end if
  13. end
  14.  
  15. on mouseDown me
  16.   set the member of sprite the spriteNum of me to the ImageDown of me
  17.   set the Clicked of me to 1
  18.   pass()
  19. end
  20.  
  21. on mouseLeave me
  22.   set the member of sprite the spriteNum of me to the ImageUp of me
  23. end
  24.  
  25. on mouseUp me
  26.   set the member of sprite the spriteNum of me to the ImageRoll of me
  27.   if the Clicked of me then
  28.     set the Clicked of me to 0
  29.     pass()
  30.   end if
  31. end
  32.  
  33. on mouseUpOutSide me
  34.   set the member of sprite the spriteNum of me to the ImageUp of me
  35.   set the Clicked of me to 0
  36. end
  37.  
  38. on beginSprite me
  39.   set the Clicked of me to 0
  40. end
  41.  
  42. on getPropertyDescriptionList
  43.   if the currentSpriteNum = 0 then
  44.     set memdefault1 to 0
  45.   else
  46.     set memref to the member of sprite the currentSpriteNum
  47.     set castLibNum to the castLibNum of memref
  48.     set memdefault0 to member the memberNum of member memref of castLib castLibNum
  49.     set memdefault1 to member (the memberNum of member memref + 1) of castLib castLibNum
  50.     set memdefault2 to member (the memberNum of member memref + 2) of castLib castLibNum
  51.   end if
  52.   set p_list to [#ImageUp: [#comment: "Button Up Image:", #format: #member, #default: memdefault0], #ImageRoll: [#comment: "Button Rollover Image:", #format: #member, #default: memdefault1], #ImageDown: [#comment: "Button Down Image:", #format: #member, #default: memdefault2]]
  53.   return p_list
  54. end
  55.  
  56. on getBehaviorDescription
  57.   return "This is a tri-state button without sounds" & RETURN & "In my opinion this button behaves like it should" & RETURN & RETURN & "PARAMETERS:" & RETURN & "ImageUp:   the cast member for the normal (not pressed state)" & RETURN & "ImageRoll: the cast member for the button when a rollover occurs" & RETURN & "ImageDown: the cast member for the button when a mousedown on the button is valid"
  58. end
  59.