home *** CD-ROM | disk | FTP | other *** search
/ George of the Jungle Press Kit / GEORGE.iso / pc / george.dxr / Internal_894_scrollBtnParentScript.ls < prev    next >
Encoding:
Text File  |  1997-06-23  |  2.1 KB  |  74 lines

  1. property ancestor
  2.  
  3. on new me, sS
  4.   set the ancestor of me to new(script "btnParentScript", sS)
  5.   return me
  6. end
  7.  
  8. on button me, whichWay
  9.   set whichSprite to the myS of me
  10.   set actNow to 0
  11.   set dnClick to "click1"
  12.   set upClick to "click2"
  13.   set playedClick to 1
  14.   set startScroll to the timer
  15.   repeat while the stillDown
  16.     if rollOver(whichSprite) then
  17.       if playedClick = 1 then
  18.         puppetSound(dnClick)
  19.         set playedClick to 0
  20.         set the memberNum of sprite whichSprite to the myDnState of me
  21.         set actNow to 1
  22.       end if
  23.       if checkScrollPosition(6, whichWay) = 0 then
  24.         if the timer < (startScroll + 180) then
  25.           set scrollAmount to 15
  26.         else
  27.           if the timer < (startScroll + 300) then
  28.             set scrollAmount to 30
  29.           else
  30.             if the timer < (startScroll + 420) then
  31.               set scrollAmount to 90
  32.             else
  33.               set scrollAmount to 150
  34.             end if
  35.           end if
  36.         end if
  37.         set newScrollPos to the scrollTop of member the memberNum of sprite 7 + (scrollAmount * whichWay)
  38.         set the scrollTop of member the memberNum of sprite sprite(7) to newScrollPos
  39.         puppetSound(dnClick)
  40.         updateStage()
  41.         if the timer < (startScroll + 420) then
  42.           wait(1)
  43.         end if
  44.       end if
  45.     else
  46.       if playedClick = 0 then
  47.         puppetSound(upClick)
  48.         set playedClick to 1
  49.         set the memberNum of sprite whichSprite to the myUpState of me
  50.         set actNow to 0
  51.       end if
  52.     end if
  53.     updateStage()
  54.   end repeat
  55.   if the memberNum of sprite whichSprite = the myDnState of me then
  56.     set the memberNum of sprite whichSprite to the myUpState of me
  57.     puppetSound(upClick)
  58.     updateStage()
  59.   end if
  60. end
  61.  
  62. on checkScrollPosition textBlockS, whichWay
  63.   set theHeightOfOneLine to 15
  64.   if ((the scrollTop of member the memberNum of sprite 7 + theHeightOfOneLine) >= the height of member the memberNum of sprite 7) and (whichWay = 1) then
  65.     return 1
  66.   else
  67.     if (the scrollTop of member the memberNum of sprite 7 <= 0) and (whichWay = -1) then
  68.       return 1
  69.     else
  70.       return 0
  71.     end if
  72.   end if
  73. end
  74.