home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1995 November / SHOWCASE.ISO / files / intro.dir / 00001_Script_1 next >
Text File  |  1995-06-14  |  8KB  |  219 lines

  1. global attractLoopList, attractLoopDataList, maxBackgrounds, nextBackground, currentBackground, cQuickTime, gTime, lastClickTime, gPresentingTo, gPresentationLight, gPTimerSet, gPresentationTime, gRedSet,  gYellowSet, gPresentationOver, lastBackgroundChange
  2.  
  3. on startmovie
  4.   set the preLoadEventAbort = TRUE -- TRS 12/10
  5.   --preload sfx for opening 'barn door' effect - JR
  6.   preLoadCast 12, 20
  7.   
  8.   memoryManIntro
  9.   put the timer into lastClickTime
  10.   -- this the channel that the QuickTime movie is in
  11.   put 16 into cQuickTime
  12.   --
  13.   set currentBackground = "AL1"
  14.   -- this is the number of backgrounds
  15.   put [1,2,3,4,5,6,7,8,9,10,11,12] into attractLoopList
  16.   --
  17.   -- this is the preload data structure for the backgrounds
  18.   -- [2,"a",2,"b",3] -- example
  19.   -- [2, <-- this is the number of pairs in the data structure
  20.   -- "a",2, <-- this is pair #1 which states that hotspot "a" has a 2 frame duration
  21.   -- "b",3] <-- this is pair #2 which states that hotspot "b" has a 3 frame duration
  22.   --
  23.   -- Assuming that the loadList ([2,"a",2,"b",3]) was for background 5, here is the labels which should
  24.   -- be in the Score:
  25.   -- AL5
  26.   -- AL5a
  27.   -- AL5b (at least 2 frames after "AL5a")
  28.   --
  29.   put [[2,"a",1,"b",1],[3,"a",1,"b",1,"c",1],[2,"a",1,"b",1],[2,"a",1,"b",1],[2,"a",1,"b",1],[2,"a",1,"b",1],¼
  30. [2,"a",1,"b",1],[2,"a",1,"b",1],[2,"a",1,"b",1],[2,"a",1,"b",1],[3,"a",1,"b",1,"c",1],[2,"a",1,"b",1]] into attractLoopDataList
  31.   --
  32.   -- this is the total number of backgrounds
  33.   put count(attractLoopList) into maxBackgrounds
  34.   -- let's initialize the next background to be loaded
  35.   put newBackground() into nextBackground
  36.     
  37.   if (NOT voidP(gPresentingTo)) OR (gPresentingTo <> EMPTY) then
  38.     put gPresentingTo into field "CompanyDisplay"
  39.   else
  40.     put " " into field "CompanyDisplay"
  41.     put "30" into field "Timer Amount"
  42.   end if
  43. end startmovie
  44.  
  45. on idle
  46.   --waitFor .1
  47.   --  updateStage -- OUT 12/9
  48. end idle
  49.  
  50. on waitFor seconds
  51.   put the timer into now
  52.   repeat while the timer < now + (seconds * 60)
  53.     if the mouseDown then exit
  54.   end repeat
  55. end waitFor
  56.  
  57.  
  58. -- this handler selects a random non-redundant background to show
  59. on newBackground
  60.   global lastChoice
  61.   put count(attractLoopList) into numChoices
  62.   -- is the list empty?
  63.   if numChoices = 0 then
  64.     -- this line should be the same as in the "startMovie" handler above
  65.     put [1,2,3,4,5,6,7,8,9,10,11,12] into attractLoopList
  66.     put maxBackgrounds into numChoices
  67.   end if
  68.   -- is this a brand new list?
  69.   if numChoices = maxBackgrounds then
  70.     put random(maxBackgrounds) into theOffset
  71.     put getAt(attractLoopList, theOffset) into theChoice
  72.     repeat while theChoice = lastChoice
  73.       put random(maxBackgrounds) into theOffset
  74.       put getAt(attractLoopList, theOffset) into theChoice
  75.     end repeat
  76.   else
  77.     -- is this the last item in the list?
  78.     if numChoices = 1 then
  79.       put getAt(attractLoopList,1) into lastChoice
  80.       put lastChoice into theChoice
  81.       put 1 into theOffset
  82.     else
  83.       -- something other than the above
  84.       put random(numChoices) into theOffset
  85.       put getAt(attractLoopList, theOffset) into theChoice
  86.     end if
  87.   end if
  88.   -- remove the selected item from the list so it won't be there the next time
  89.   deleteAt(attractLoopList, theOffset)
  90.   --  put theChoice, theOffset ---
  91.   -- return the selected background number
  92.   return theChoice
  93. end newBackground
  94.  
  95. on preloadBackground whichOne
  96.   --  put the timer into now -- TRS
  97.   -- grab the list of data to preload
  98.   put getAt(attractLoopDataList, whichOne) into loadList
  99.   -- preload the background frame first
  100.   put "AL"&string(whichOne) into theFrame
  101.   --  put theFrame ---
  102.   preload theFrame, theFrame
  103.   -- now let's preload the hotspot graphics
  104.   put getAt(loadList,1) into numScenes
  105.   repeat with x = 1 to numScenes
  106.     put "AL"&string(whichOne)&getAt(loadList,(x*2)) into theFrame
  107.     put label(theFrame) into firstFrame
  108.     --    put firstFrame + getAt(loadList,(x*2)+1) - 1 into lastFrame -- TRS
  109.     --    put firstFrame, lastFrame ---
  110.     --    preload firstFrame, lastFrame -- TRS
  111.     preload firstFrame, firstFrame
  112.   end repeat
  113.   --  repeat while the timer < now + (60 * 1) -- TRS
  114.   --    -- if the mouseDown then exit
  115.   --  end repeat -- TRS
  116.   --  set the movieRate of sprite cQuickTime = 1
  117. end preloadBackground
  118.  
  119. on changeBackground
  120.   put "AL"&string(nextBackground) into theFrame
  121.   put theFrame into currentBackground
  122.   --  puppetsOff -- TRS
  123.   puppetSprite 3, FALSE
  124.   puppetSprite 4, FALSE
  125.   puppetSprite 5, FALSE
  126.   puppetSprite 6, FALSE
  127.   puppetSprite 7, FALSE
  128.   go to theFrame
  129.   --  To make sure all the channels with elements are puppeted
  130.   puppetSprite 3, TRUE
  131.   puppetSprite 4, TRUE
  132.   puppetSprite 5, TRUE
  133.   puppetSprite 6, TRUE
  134.   puppetSprite 7, TRUE
  135.   put newBackground() into nextBackground
  136.   put the ticks into lastBackgroundChange
  137. end changeBackground
  138.  
  139. on changeHotspot whichOne
  140.   --  Capture the sprite info before anything can change the value
  141.   --  put the mouseCast into whichCast
  142.   put the clickOn into whichSprite
  143.   put the castNum of sprite whichSprite into whichCast
  144.   put (the name of cast whichCast) into myName
  145.   put (currentBackground & whichOne) into theSpot
  146.   --  put theSpot
  147.   put the last word of myName into myNum
  148.   put not value(myNum) into word (the number of words in myName) of myName
  149.   --  puppetSprite the clickOn, FALSE
  150.   -- if myName = "1" then the QuickTime movie was clicked on, ignore it
  151.   -- if myName <> "1" then 
  152.   set the castNum of sprite whichSprite = cast myName
  153.   put the ticks into lastBackgroundChange
  154.   go to theSpot
  155.   --  end if
  156.   --  puppetSprite the clickOn, TRUE
  157. end changeHotspot
  158.  
  159. on puppetsOff
  160.   repeat with x = 3 to 7
  161.     puppetSprite x, FALSE
  162.   end repeat
  163. end puppetsOff
  164.  
  165. on delayfor n
  166.   starttimer
  167.   repeat while the timer < n
  168.   end repeat
  169. end
  170.  
  171. on checkey
  172.   global delaytime
  173.   if the key = "0" then set delaytime = 9
  174.   if the key = "1" then set delaytime = 8
  175.   if the key = "2" then set delaytime = 7
  176.   if the key = "3" then set delaytime = 6
  177.   if the key = "4" then set delaytime = 5
  178.   if the key = "5" then set delaytime = 4
  179.   if the key = "6" then set delaytime = 3
  180.   if the key = "7" then set delaytime = 2
  181.   if the key = "8" then set delaytime = 1
  182.   if the key = "9" then set delaytime = 0
  183.   --  if the key = "m" then go to movie "interface mockup"
  184. end checkey
  185.  
  186. on mainButtonSelect whichOne
  187.   global whichSprite
  188.   put the clickOn into whichSprite
  189.   puppetSprite whichSprite, TRUE
  190.   set the castnum of sprite whichSprite = ¼
  191.     the number of cast (the name of cast (the castnum of sprite whichSprite) && "lit")
  192.   updatestage
  193.   repeat while the stillDown
  194.   end repeat
  195.   puppetSprite whichSprite, FALSE
  196.   put [#macromedia:"vision",#tools:"tools",#services:"support",#gallery:"gallery"] into thePlaces
  197.   put getProp(thePlaces,whichOne) into destination
  198.   go to movie destination
  199. end
  200.  
  201. on memoryManIntro
  202.   preLoadCast (the number of cast "Volume Down"), (the number of cast "Quit")
  203.   preLoadCast (the number of cast "Volume Down lit"), (the number of cast "Quit lit")
  204.   preLoadCast (the number of cast "sound level 0"), (the number of cast "sound level 6")
  205.   preLoadCast (the number of cast "main macromedia"), (the number of cast "basic panel")
  206.   preLoadCast (the number of cast "basic panel grey")
  207. end
  208.  
  209. on randomSting 
  210.   put random(8) into randomNumy
  211.   if randomNumy = "1" then puppetsound "MMsting1.aif"
  212.   if randomNumy = "2" then puppetsound "MMsting2.aif"
  213.   if randomNumy = "3" then puppetsound "MMsting3.aif"
  214.   if randomNumy = "4" then puppetsound "MMsting4.aif"
  215.   if randomNumy = "5" then puppetsound "MMsting5.aif"
  216.   if randomNumy = "6" then puppetsound "MMsting6.aif"
  217.   if randomNumy = "7" then puppetsound "MMsting7.aif"
  218.   if randomNumy = "8" then puppetsound "MMsting8.aif"
  219. end randomSting