home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 March / CHIP Turkiye Mart 1999.iso / araclar / Win98 / HTML-Tool / DWESD.EXE / data.z / behaviors.dcr / Standard_113_Paging.ls < prev    next >
Encoding:
Text File  |  1998-04-02  |  5.6 KB  |  151 lines

  1. property offCast, onCast, rollOverCast, mouseDownCast, currentOverCast, startCast, whichWay, otherSprite, textSprite, pageStatus
  2.  
  3. on beginSprite me
  4.   set currentOverCast to rollOverCast
  5.   if whichWay = #up then
  6.     set the member of sprite the spriteNum of me to member the offCast of me
  7.     set pageStatus to #first
  8.   else
  9.     if whichWay = #down then
  10.       if the name of the member of sprite textSprite contains "first" then
  11.         set the member of sprite the spriteNum of me to member the onCast of me
  12.         set pageStatus to #first
  13.       else
  14.         set the member of sprite the spriteNum of me to member the offCast of me
  15.         set pageStatus to #other
  16.       end if
  17.     end if
  18.   end if
  19. end
  20.  
  21. on mouseWithin me
  22.   case whichWay of
  23.     #up:
  24.       if pageStatus = #first then
  25.         exit
  26.       end if
  27.     #down:
  28.       if pageStatus = #last then
  29.         exit
  30.       end if
  31.   end case
  32.   if pageStatus = #other then
  33.     exit
  34.   end if
  35.   set the member of sprite the spriteNum of me to currentOverCast
  36. end
  37.  
  38. on mouseLeave me
  39.   case whichWay of
  40.     #up:
  41.       if pageStatus = #first then
  42.         exit
  43.       end if
  44.     #down:
  45.       if pageStatus = #last then
  46.         exit
  47.       end if
  48.   end case
  49.   if pageStatus = #other then
  50.     exit
  51.   end if
  52.   set the member of sprite the spriteNum of me to onCast
  53. end
  54.  
  55. on mouseDown me
  56.   case whichWay of
  57.     #up:
  58.       if pageStatus = #first then
  59.         exit
  60.       end if
  61.     #down:
  62.       if pageStatus = #last then
  63.         exit
  64.       end if
  65.   end case
  66.   if pageStatus = #other then
  67.     exit
  68.   end if
  69.   set currentOverCast to the mouseDownCast of me
  70.   set the member of sprite the spriteNum of me to member the mouseDownCast of me
  71. end
  72.  
  73. on mouseUp me
  74.   if the name of the member of sprite the spriteNum of me = offCast then
  75.     exit
  76.   end if
  77.   set currentOverCast to rollOverCast
  78.   wait(7)
  79.   set the member of sprite the spriteNum of me to currentOverCast
  80.   case whichWay of
  81.     #up:
  82.       set the member of sprite textSprite to member (the memberNum of sprite textSprite - 1) of castLib the castLibNum of sprite textSprite
  83.       if the name of the member of sprite textSprite contains "first" then
  84.         set pageStatus to #first
  85.         set the member of sprite the spriteNum of me to offCast
  86.       end if
  87.       updateStage()
  88.       sendSprite(otherSprite, #showSprite, otherSprite)
  89.     #down:
  90.       set the member of sprite textSprite to member (the memberNum of sprite textSprite + 1) of castLib the castLibNum of sprite textSprite
  91.       if the name of the member of sprite textSprite contains "last" then
  92.         set pageStatus to #last
  93.         set the member of sprite the spriteNum of me to offCast
  94.       end if
  95.       updateStage()
  96.       sendSprite(otherSprite, #showSprite, otherSprite)
  97.   end case
  98. end
  99.  
  100. on mouseUpOutSide me
  101.   case whichWay of
  102.     #up:
  103.       if pageStatus = #first then
  104.         exit
  105.       end if
  106.     #down:
  107.       if pageStatus = #last then
  108.         exit
  109.       end if
  110.   end case
  111.   if pageStatus = #other then
  112.     exit
  113.   end if
  114.   set currentOverCast to the rollOverCast of me
  115. end
  116.  
  117. on showSprite me
  118.   set the member of sprite the spriteNum of me to member the onCast of me
  119. end
  120.  
  121. on getPropertyDescriptionList
  122.   if the currentSpriteNum = 0 then
  123.     set onCastDefault to 0
  124.     set rollOverCastDefault to 0
  125.     set mouseDownCastDefault to 0
  126.     set textSpriteDefault to 0
  127.   else
  128.     set memberRef to the member of sprite the currentSpriteNum
  129.     set castLibNum to the castLibNum of memberRef
  130.     set offCastDefault to the member of sprite the currentSpriteNum
  131.     set onCastDefault to member (the memberNum of member memberRef + 1) of castLib castLibNum
  132.     set rollOverCastDefault to member (the memberNum of member memberRef + 2) of castLib castLibNum
  133.     set mouseDownCastDefault to member (the memberNum of member memberRef + 3) of castLib castLibNum
  134.     if the name of member the member of sprite the currentSpriteNum contains "up" then
  135.       set whichWayDefault to #up
  136.       set otherSpriteDefault to the currentSpriteNum + 1
  137.       set textSpriteDefault to the currentSpriteNum - 1
  138.     else
  139.       set whichWayDefault to #down
  140.       set otherSpriteDefault to the currentSpriteNum - 1
  141.       set textSpriteDefault to the currentSpriteNum - 2
  142.     end if
  143.   end if
  144.   set propertyDescriptionList to [#whichWay: [#comment: "Page up or down?:", #format: #symbol, #range: [#up, #down], #default: whichWayDefault], #offCast: [#comment: "Off cast:", #format: #graphic, #default: offCastDefault], #onCast: [#comment: "On cast:", #format: #graphic, #default: onCastDefault], #rollOverCast: [#comment: "rollOver cast:", #format: #graphic, #default: rollOverCastDefault], #mouseDownCast: [#comment: "mouseDown Cast:", #format: #graphic, #default: mouseDownCastDefault], #otherSprite: [#comment: "Other page sprite:", #format: #integer, #default: otherSpriteDefault], #textSprite: [#comment: "Text sprite:", #format: #integer, #default: textSpriteDefault]]
  145.   return propertyDescriptionList
  146. end
  147.  
  148. on getBehaviorDescription
  149.   return "This behavior does up and down paging.  It requires a setup with a text sprite, a page up sprite and a page down sprite.  It works best when they are in the following order:" & RETURN & RETURN & "     Sprite n is the text sprite" & RETURN & "     Sprite n + 1 is the page up button (use the off version of the button)" & RETURN & "     Sprite n + 2 is the page down button (also use the off version)" & RETURN & RETURN & "If it's set up right, you won't need to reset any of the properties.  It's also required to set up the text pages in sequence in the cast, and use the word " & QUOTE & "first" & QUOTE & " in the name of the first cast, and the word " & QUOTE & "last" & QUOTE & " in the name of the last cast."
  150. end
  151.