home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1995 November / SHOWCASE.ISO / files / vision.dir / 00191_Script_191 < prev    next >
Text File  |  1995-06-14  |  6KB  |  165 lines

  1. global cAudioLevel, gLastSprite, gPTimerSet, gPresentationTime, gRedSet, gPresentationLight, gYellowSet, gLightColor
  2. global gSoundlevel, gTextBallLocV
  3.  
  4. --JR's globals
  5. global gForgive
  6.  
  7. -- Dave's new globals
  8. global gOrigTextLocV, gConstrSprite1, gBallSprite1, gTextSprite1, gHiliteColor, gWindowHeight
  9.  
  10. global gIndexSpriteH, gIndexSpriteV, gTextSprite2, gConstrSpriteH, gBallSprite2V, gBallSprite2H
  11. global gWindowHeight2, gWindowWidth2, gConstrSprite2V, gConstrSprite2H
  12. global gOrigTextLocH, gOrigIndexLocV, gOrigIndexLocH
  13.  
  14.  
  15. on startmovie
  16.   set the floatPrecision = 3
  17.   setGlobalConstants
  18.   --  init JR's globals
  19.   --  set gForgive = 20
  20.   --  set gTextBallLocV = 91
  21.   set gPresentationLight = 48
  22.   set cAudioLevel = 46
  23.   puppetSprite cAudioLevel, TRUE
  24.   set the castnum of sprite cAudioLevel = the number of cast ("sound level" && gSoundlevel)
  25.   preLoadCast 231, 237
  26.   set gLastSprite = 0
  27.   if gPTimerSet then
  28.     puppetSprite gPresentationLight, 1
  29.     set the castnum of sprite gPresentationLight = the number of cast gLightColor
  30.   end if
  31.   updatestage
  32. end
  33.  
  34. on setGlobalConstants
  35.   set gHiliteColor = 113
  36.   set gWindowHeight = 272
  37.   set gTextSprite1 = 4
  38.   set gConstrSprite1 = 16
  39.   set gBallSprite1 = 19
  40.   set gIndexSpriteH = 8
  41.   set gIndexSpriteV = 9
  42.   set gTextSprite2 = 6
  43.   set gConstrSprite2V = 16
  44.   set gConstrSprite2H = 21
  45.   set gBallSprite2V = 19
  46.   set gBallSprite2H = 24
  47.   set gWindowHeight2 = 200
  48.   set gWindowWidth2 = 312
  49. end
  50.  
  51. -- Scroll handler for first set of annuals.
  52. -- Arguments: whichSprite is the arrow being clicked; whichWay is direction: -1 for up, 1 for down.
  53.  
  54. on scrollArrow whichSprite, whichWay
  55.   puppetSprite whichSprite, 1
  56.   set the castnum of sprite whichSprite = ¼
  57.     the number of cast  (the name of cast(the castnum of sprite whichSprite) && "lit")  
  58.   
  59.   set constrainOffset = the top of sprite gConstrSprite1
  60.   set textSpriteHeight = the height of sprite gTextSprite1
  61.   set travelLength = textSpriteHeight - gWindowHeight
  62.   set the constraint of sprite gBallSprite1 = gConstrSprite1
  63.   --  set the forecolor of sprite gBallSprite1 = gHiliteColor
  64.   
  65.   repeat while the stilldown
  66.     set the locV of sprite gBallSprite1 = the locV of sprite gBallSprite1 + whichWay
  67.     set ballDistance = the locV of sprite gBallSprite1 - constrainOffset
  68.     set ballPer = ballDistance/float(the height of sprite gConstrSprite1)
  69.     set the locV of sprite gTextSprite1 = gOrigTextLocV - (ballPer * travelLength)
  70.     updatestage
  71.   end repeat
  72.   
  73.   set the castnum of sprite whichSprite = ¼
  74.     the number of cast  (word 1 of the name of cast(the castnum of sprite whichSprite))  
  75.   --  set the forecolor of sprite gBallSprite1 = 255
  76.   updatestage
  77.   
  78.   puppetSprite whichSprite, 0
  79.   
  80. end
  81.  
  82. on scrollArrow2V whichSprite, whichWay
  83.   puppetSprite whichSprite, 1
  84.   set the castnum of sprite whichSprite = ¼
  85.     the number of cast  (the name of cast(the castnum of sprite whichSprite) && "lit")  
  86.   
  87.   set constrainOffset = the top of sprite gConstrSprite2V
  88.   set textSpriteHeight = the height of sprite gTextSprite2
  89.   set travelLength = textSpriteHeight - gWindowHeight2
  90.   set the constraint of sprite gBallSprite2V = gConstrSprite2V
  91.   
  92.   repeat while the stilldown
  93.     set the locV of sprite gBallSprite2V = the locV of sprite gBallSprite2V + whichWay
  94.     set ballDistance = the locV of sprite gBallSprite2V - constrainOffset
  95.     set ballPer = ballDistance/float(the height of sprite gConstrSprite2V)
  96.     set the locV of sprite gTextSprite2 = gOrigTextLocV - (ballPer * travelLength)
  97.     set the locV of sprite gIndexSpriteV = gOrigIndexLocV - (ballPer * travelLength)
  98.     updatestage
  99.   end repeat
  100.   
  101.   set the castnum of sprite whichSprite = ¼
  102.     the number of cast  (word 1 of the name of cast(the castnum of sprite whichSprite))  
  103.   updatestage
  104.   
  105.   puppetSprite whichSprite, 0
  106.   
  107. end
  108.  
  109. on scrollArrow2H whichSprite, whichWay
  110.   puppetSprite whichSprite, 1
  111.   set the castnum of sprite whichSprite = ¼
  112.     the number of cast  (the name of cast(the castnum of sprite whichSprite) && "lit")  
  113.   
  114.   set constrainOffset = the left of sprite gConstrSprite2H
  115.   set textSpriteWidth = the width of sprite gTextSprite2
  116.   set travelLength = textSpriteWidth - gWindowWidth2
  117.   set the constraint of sprite gBallSprite2H = gConstrSprite2H
  118.   
  119.   repeat while the stilldown
  120.     set the locH of sprite gBallSprite2H = the locH of sprite gBallSprite2H + whichWay
  121.     set ballDistance = the locH of sprite gBallSprite2H - constrainOffset
  122.     set ballPer = ballDistance/float(the width of sprite gConstrSprite2H)
  123.     set the locH of sprite gTextSprite2 = gOrigTextLocH - (ballPer * travelLength)
  124.     set the locH of sprite gIndexSpriteH = gOrigIndexLocH - (ballPer * travelLength)
  125.     updatestage
  126.   end repeat
  127.   
  128.   set the castnum of sprite whichSprite = ¼
  129.     the number of cast  (word 1 of the name of cast(the castnum of sprite whichSprite))  
  130.   updatestage
  131.   
  132.   puppetSprite whichSprite, 0
  133.   
  134. end
  135.  
  136.  
  137.  
  138.  
  139. -- For presentation timer.
  140. on enterFrame  
  141.   if gPTimerSet then
  142.     if  the timer > (gPresentationTime * 3600) AND not gRedSet then
  143.       set gLightColor = "Red timer light lit"
  144.       set the castnum of sprite gPresentationLight = the number of cast gLightColor
  145.       set gRedSet = TRUE
  146.       exit 
  147.     end if
  148.     if the timer > ((gPresentationTime * 3600)  - 7200) AND not gYellowSet then
  149.       set gLightColor = "Yellow timer light lit"
  150.       set the castnum of sprite gPresentationLight = the number of cast gLightColor
  151.       set gYellowSet = TRUE
  152.     end if
  153.   end if
  154.   if the freebytes < 300000 then unload
  155. end    
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.