home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_104_scroll Down button.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  1.7 KB  |  73 lines

  1. property ScrollThumbSprite, DownMember, button_active
  2.  
  3. on getPropertyDescriptionList
  4.   set description to [:]
  5.   if the currentSpriteNum = 0 then
  6.     set memdefault to 0
  7.   else
  8.     set memref to the member of sprite the currentSpriteNum
  9.     set castLibNum to the castLibNum of memref
  10.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  11.   end if
  12.   addProp(description, #DownMember, [#default: memdefault, #format: #bitmap, #comment: "Pict for Down:"])
  13.   addProp(description, #ScrollThumbSprite, [#default: the currentSpriteNum - 1, #format: #integer, #comment: "Sprite Number of Thumb:"])
  14.   return description
  15. end
  16.  
  17. on getBehaviorDescription
  18.   return "Vertical Multiline Textfield Scroll Up Button"
  19. end
  20.  
  21. on getAssocMembers
  22.   set myPropList to [DownMember]
  23.   return myPropList
  24. end
  25.  
  26. on endSprite me
  27.   puppetSprite(the spriteNum of me, 0)
  28. end
  29.  
  30. on mouseUp me
  31.   set the button_active of me to 0
  32.   swap_members(me)
  33.   sendSprite(the ScrollThumbSprite of me, #scroll_a_line, 1)
  34. end
  35.  
  36. on mouseUpOutSide me
  37.   set the button_active of me to 0
  38. end
  39.  
  40. on mouseDown me
  41.   swap_members(me)
  42.   set the button_active of me to 1
  43.   startTimer()
  44. end
  45.  
  46. on mouseLeave me
  47.   if the button_active of me then
  48.     swap_members(me)
  49.   end if
  50. end
  51.  
  52. on mouseEnter me
  53.   if the button_active of me then
  54.     swap_members(me)
  55.     startTimer()
  56.   end if
  57. end
  58.  
  59. on exitFrame me
  60.   if the button_active of me then
  61.     if the timer > 30 then
  62.       sendSprite(the ScrollThumbSprite of me, #scroll_a_line, 1)
  63.     end if
  64.   end if
  65. end
  66.  
  67. on swap_members me
  68.   puppetSprite(the spriteNum of me, 1)
  69.   set temp to the member of sprite the spriteNum of me
  70.   set the member of sprite the spriteNum of me to member the DownMember of me
  71.   set the DownMember of me to temp
  72. end
  73.