home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1995 September / PCD0995.ISO / files / gallery.dir / 00001.ls next >
Encoding:
Text File  |  1994-12-18  |  13.3 KB  |  348 lines

  1. global demoQTstate, cDemoQT, gSectionPressed, gGalleryList, gFirstGoRound, gProductList, gReturnFromDemo, gProductSelect, gSectionSelect, cAudioLevel, gPauseSprite, gPlaySprite, gStopSprite, gRewindSprite, gFforwardSprite, gDemoButtonSprite, gPictureList, gNumOPics, gCurrentPicture, gFirstProductButton, gLastProductButton, gPictureSprite, gCurrentSection, gLeftFromQT, gMacIDSprite, gWindowsIDSprite, gLaunchQTButton, gMyPath, gPTimerSet, gPresentationTime, gPresentationLight, gYellowSet, gRedSet, gLightColor
  2.  
  3. on startMovie
  4.   sound stop 1
  5.   sound stop 2
  6.   set gFirstProductButton to 3
  7.   set gLastProductButton to 10
  8.   set gDemoButtonSprite to 11
  9.   set gRewindSprite to 12
  10.   set gFforwardSprite to 13
  11.   set gStopSprite to 14
  12.   set gPauseSprite to 15
  13.   set gPlaySprite to 16
  14.   set gMacIDSprite to 17
  15.   set gWindowsIDSprite to 18
  16.   set cDemoQT to 31
  17.   set gPictureSprite to 34
  18.   set gLaunchQTButton to 37
  19.   set cAudioLevel to 46
  20.   set the preLoadEventAbort to 1
  21.   if gReturnFromDemo = 1 then
  22.     set gReturnFromDemo to 0
  23.     if gLeftFromQT = 1 then
  24.       set the movieRate of sprite cDemoQT to 0
  25.       set the movieTime of sprite cDemoQT to 0
  26.       set demoQTstate to #stop
  27.     else
  28.       puppetSprite(gLaunchQTButton, 1)
  29.       puppetSprite(gPictureSprite, 1)
  30.       set the castNum of sprite gLaunchQTButton to the number of cast "PlayQT"
  31.       set the castNum of sprite gPictureSprite to the number of cast (string(gCurrentSection) & string(gCurrentPicture))
  32.     end if
  33.     puppetSprite(gMacIDSprite, 1)
  34.     puppetSprite(gWindowsIDSprite, 1)
  35.     puppetSprite(gDemoButtonSprite, 1)
  36.     if gProductSelect <> #null then
  37.       set sectionFlags to getProp(gProductList, gProductSelect)
  38.       if getAt(sectionFlags, 1) then
  39.         set the castNum of sprite gMacIDSprite to the number of cast "macID lit"
  40.       else
  41.         set the castNum of sprite gMacIDSprite to the number of cast "macID"
  42.       end if
  43.       if getAt(sectionFlags, 2) then
  44.         set the castNum of sprite gWindowsIDSprite to the number of cast "windowsID lit"
  45.       else
  46.         set the castNum of sprite gWindowsIDSprite to the number of cast "windowsID"
  47.       end if
  48.       if the machineType <> 256 then
  49.         if getAt(sectionFlags, 3) then
  50.           set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo"
  51.         else
  52.           set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo lit"
  53.         end if
  54.       else
  55.         if getAt(sectionFlags, 4) then
  56.           set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo"
  57.         else
  58.           set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo lit"
  59.         end if
  60.       end if
  61.       puppetSprite(gSectionPressed, 1)
  62.       puppetSprite(gDemoButtonSprite, 1)
  63.       set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo"
  64.       set whichCast to string(gSectionSelect)
  65.       set the castNum of sprite gSectionPressed to the number of cast (whichCast && "lit")
  66.     end if
  67.   end if
  68.   if gPTimerSet then
  69.     puppetSprite(gPresentationLight, 1)
  70.     set the castNum of sprite gPresentationLight to the number of cast gLightColor
  71.     updateStage()
  72.   end if
  73. end
  74.  
  75. on initGallery
  76.   global soundLevel, gProductSelect, gSectionSelect, gProductPressed, gSectionPressed, gReturnFromDemo, cDemoQT, demoQTstate, gGalleryList, gProductList
  77.   set gFirstGoRound to 0
  78.   set gProductSelect to #null
  79.   set gSectionSelect to EMPTY
  80.   set gProductPressed to 0
  81.   set gSectionPressed to 0
  82.   set demoQTstate to #stop
  83.   set gGalleryList to [#presentations: [#jobseek, #longevity, #sancwoods], #sales: [#virtualdrive, #intershop, #elliott, #cmddemo], #courseware: [#nasa, #connect, #lite], #consumer: [#startrek, #helix, #strad, #keroppi], #kiosks: [#telefono, #napa], #graphics: [#dreamlight, #freakshow, #medicine], #custom: [#imps, #mediaband], #macromedia: [#macromedia]]
  84.   set gProductList to [#jobseek: [1, 1, 1, 1], #longevity: [1, 1, 0, 0], #sancwoods: [1, 1, 1, 1], #virtualdrive: [1, 1, 0, 0], #intershop: [1, 1, 0, 0], #elliott: [1, 1, 1, 1], #cmddemo: [1, 1, 0, 0], #nasa: [1, 1, 0, 0], #connect: [1, 1, 0, 0], #lite: [1, 1, 0, 0], #startrek: [1, 1, 0, 0], #helix: [1, 1, 0, 0], #strad: [1, 1, 0, 0], #keroppi: [1, 1, 1, 1], #telefono: [1, 1, 1, 1], #napa: [1, 0, 0, 0], #dreamlight: [1, 1, 0, 0], #freakshow: [1, 1, 0, 0], #medicine: [1, 1, 0, 0], #imps: [1, 1, 1, 0], #mediaband: [1, 1, 1, 1]]
  85.   set gPictureList to [#presentations: 4, #sales: 5, #courseware: 4, #consumer: 5, #kiosks: 3, #graphics: 4, #custom: 3, #macromedia: 1]
  86. end
  87.  
  88. on playGalleryDemo whichOne
  89.   set gReturnFromDemo to 1
  90.   if whichOne = #sancwoods then
  91.     if the machineType = 256 then
  92.       play movie gMyPath & "DEMOS\SANCWOOD\SANCWOOD.DIR"
  93.     else
  94.       play movie gMyPath & "DEMOS:SANCWOOD:SANCWOOD.DIR"
  95.     end if
  96.     exit
  97.   end if
  98.   if whichOne = #jobseek then
  99.     if the machineType = 256 then
  100.       play movie gMyPath & "DEMOS\JOBSWIN\JOBSEEK.DIR"
  101.     else
  102.       play movie gMyPath & "DEMOS:JOBSEEK:JOBSEEK.DIR"
  103.     end if
  104.     exit
  105.   end if
  106.   if whichOne = #elliott then
  107.     if the machineType = 256 then
  108.       play movie gMyPath & "DEMOS\ELLIOTTD\ELLIOTTD.DIR"
  109.     else
  110.       play movie gMyPath & "DEMOS:ELLIOTTD:ELLIOTTD.DIR"
  111.     end if
  112.     exit
  113.   end if
  114.   if whichOne = #keroppi then
  115.     if the machineType = 256 then
  116.       play movie gMyPath & "DEMOS\KEROPPIW\KP_INTRO.DIR"
  117.     else
  118.       play movie gMyPath & "DEMOS:KEROPPI:KP_INTRO.DIR"
  119.     end if
  120.     exit
  121.   end if
  122.   if whichOne = #telefono then
  123.     if the machineType = 256 then
  124.       play movie gMyPath & "DEMOS\ELTELDEM\ETDEMO.DIR"
  125.     else
  126.       play movie gMyPath & "DEMOS:ELTELDEM:ETDEMO.DIR"
  127.     end if
  128.     exit
  129.   end if
  130.   if whichOne = #imps then
  131.     if the machineType = 256 then
  132.       play movie gMyPath & "DEMOS\WOODSTOK\WOODSTOK"
  133.     else
  134.       play movie gMyPath & "DEMOS:WOODSTOK:WOODSTOK"
  135.     end if
  136.     exit
  137.   end if
  138.   if whichOne = #mediaband then
  139.     if the machineType = 256 then
  140.       play movie gMyPath & "DEMOS\MEDIABAN\HOUSEJAM"
  141.     else
  142.       play movie gMyPath & "DEMOS:MEDIABAN:HOUSEJAM"
  143.     end if
  144.     exit
  145.   end if
  146. end
  147.  
  148. on galleryQTplay
  149.   set WhichSprite to the clickOn
  150.   puppetSprite(WhichSprite, 1)
  151.   set the castNum of sprite gPlaySprite to the number of cast "playGallery lit"
  152.   set the movieRate of sprite cDemoQT to 1
  153.   set demoQTstate to #play
  154.   set the castNum of sprite gStopSprite to the number of cast "stopGallery"
  155.   set the castNum of sprite gPauseSprite to the number of cast "pauseGallery"
  156.   updateStage()
  157. end
  158.  
  159. on galleryQTpause
  160.   set WhichSprite to the clickOn
  161.   puppetSprite(WhichSprite, 1)
  162.   set the castNum of sprite gPauseSprite to the number of cast "pauseGallery lit"
  163.   if demoQTstate = #play then
  164.     set the movieRate of sprite cDemoQT to 0
  165.     set demoQTstate to #pause
  166.     set the castNum of sprite gPlaySprite to the number of cast "playGallery"
  167.     updateStage()
  168.   else
  169.     if demoQTstate = #pause then
  170.       set the movieRate of sprite cDemoQT to 1
  171.       set demoQTstate to #play
  172.       set the castNum of sprite gPauseSprite to the number of cast "pauseGallery"
  173.       set the castNum of sprite gPlaySprite to the number of cast "playGallery lit"
  174.       updateStage()
  175.     end if
  176.   end if
  177. end
  178.  
  179. on galleryQTstop
  180.   set WhichSprite to the clickOn
  181.   puppetSprite(WhichSprite, 1)
  182.   set the movieTime of sprite cDemoQT to 0
  183.   set the movieRate of sprite cDemoQT to 0
  184.   returnToSection()
  185.   set the castNum of sprite gStopSprite to the number of cast "stopGallery"
  186.   set the castNum of sprite gPauseSprite to the number of cast "pauseGallery"
  187.   set the castNum of sprite gPlaySprite to the number of cast "playGallery"
  188.   updateStage()
  189. end
  190.  
  191. on galleryQTfforward
  192.   set WhichSprite to the clickOn
  193.   puppetSprite(WhichSprite, 1)
  194.   set the castNum of sprite gFforwardSprite to the number of cast "fforwardGallery lit"
  195.   set the movieRate of sprite cDemoQT to 2
  196.   repeat while the stillDown
  197.     updateStage()
  198.   end repeat
  199.   if the movieTime of sprite cDemoQT = the stopTime of sprite cDemoQT then
  200.     set the movieTime of sprite cDemoQT to 0
  201.     set the movieRate of sprite cDemoQT to 0
  202.     returnToSection()
  203.     exit
  204.   end if
  205.   if (demoQTstate = #pause) or (demoQTstate = #stop) then
  206.     set the movieRate of sprite cDemoQT to 0
  207.   else
  208.     set the movieRate of sprite cDemoQT to 1
  209.   end if
  210. end
  211.  
  212. on galleryQTrewind
  213.   set WhichSprite to the clickOn
  214.   puppetSprite(WhichSprite, 1)
  215.   set the castNum of sprite gRewindSprite to the number of cast "rewindGallery lit"
  216.   set the movieRate of sprite cDemoQT to -2
  217.   repeat while the stillDown
  218.     updateStage()
  219.   end repeat
  220.   if (demoQTstate = #pause) or (demoQTstate = #stop) then
  221.     set the movieRate of sprite cDemoQT to 0
  222.   else
  223.     set the movieRate of sprite cDemoQT to 1
  224.   end if
  225.   exit
  226. end
  227.  
  228. on resetVideoButt
  229.   set the castNum of sprite gPlaySprite to the number of cast "playGallery"
  230.   set the castNum of sprite gStopSprite to the number of cast "stopGallery"
  231.   set the castNum of sprite gPauseSprite to the number of cast "pauseGallery"
  232.   set the castNum of sprite gFforwardSprite to the number of cast "fforwardGallery"
  233.   set the castNum of sprite gRewindSprite to the number of cast "rewindGallery"
  234. end
  235.  
  236. on gallerySelect whichSection
  237.   global gProductPressed, gSectionPressed, gProductSelect, gSectionSelect, gReturnFromDemo, gCompColor, gGalleryList, cDemoQT, gMacIDSprite, gWindowsIDSprite, gDemoButtonSprite
  238.   puppetSound("click")
  239.   set gProductSelect to #null
  240.   puppetSprite(cDemoQT, 0)
  241.   resetVideoButt()
  242.   set WhichSprite to the clickOn
  243.   puppetSprite(WhichSprite, 1)
  244.   set whichCast to the name of cast the castNum of sprite WhichSprite
  245.   set gSectionPressed to WhichSprite
  246.   set gSectionSelect to whichSection
  247.   set the castNum of sprite WhichSprite to the number of cast (whichCast && "lit")
  248.   repeat with x = gFirstProductButton to gLastProductButton
  249.     if x <> gSectionPressed then
  250.       puppetSprite(x, 0)
  251.     end if
  252.   end repeat
  253.   set the castNum of sprite gMacIDSprite to the number of cast "macID"
  254.   set the castNum of sprite gWindowsIDSprite to the number of cast "windowsID"
  255.   set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo lit"
  256.   updateStage()
  257.   go(string(getPropAt(gGalleryList, WhichSprite - 2)))
  258.   set gNumOPics to getProp(gPictureList, whichSection)
  259.   set gCurrentSection to whichSection
  260.   set gCurrentPicture to 1
  261. end
  262.  
  263. on returnToSection
  264.   global gProductPressed, gSectionPressed, gProductSelect, gSectionSelect, gGalleryList, cDemoQT
  265.   puppetSprite(cDemoQT, 0)
  266.   repeat with n = gStopSprite to gPlaySprite
  267.     set offcast to word 1 of the name of cast the castNum of sprite n
  268.     set the castNum of sprite n to the number of cast offcast
  269.   end repeat
  270.   go(string(getPropAt(gGalleryList, gSectionPressed - 2)))
  271. end
  272.  
  273. on galleryProductSelect whichSection
  274.   global gProductPressed, gSectionPressed, gProductSelect, gSectionSelect, gReturnFromDemo, gCompColor, gGalleryList
  275.   if whichSection = #null then
  276.     set the castNum of sprite gMacIDSprite to the number of cast "macID"
  277.     set the castNum of sprite gMacIDSprite to the number of cast "windowsID"
  278.     exit
  279.   else
  280.     if the machineType <> 256 then
  281.       puppetSound("click")
  282.     end if
  283.     puppetSprite(gPlaySprite, 1)
  284.     puppetSprite(gLaunchQTButton, 0)
  285.     set the castNum of sprite gPlaySprite to the number of cast "playGallery lit"
  286.     set WhichSprite to the clickOn
  287.     set whichCast to the name of cast the castNum of sprite WhichSprite
  288.     set gProductPressed to WhichSprite
  289.     set gProductSelect to whichSection
  290.     go(string(whichSection))
  291.     set sectionFlags to getProp(gProductList, gProductSelect)
  292.     if getAt(sectionFlags, 1) then
  293.       set the castNum of sprite gMacIDSprite to the number of cast "macID lit"
  294.     end if
  295.     if getAt(sectionFlags, 2) then
  296.       set the castNum of sprite gWindowsIDSprite to the number of cast "windowsID lit"
  297.     end if
  298.     if (the machineType <> 256) and getAt(sectionFlags, 3) then
  299.       set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo"
  300.     end if
  301.     if (the machineType = 256) and getAt(sectionFlags, 4) then
  302.       set the castNum of sprite gDemoButtonSprite to the number of cast "GoDemo"
  303.     end if
  304.     updateStage()
  305.     galleryQTstart()
  306.   end if
  307. end
  308.  
  309. on galleryQTstart
  310.   global demoQTstate, cDemoQT, gSoundlevel
  311.   set the movieRate of sprite cDemoQT to 1
  312.   set the volume of sprite cDemoQT to 256
  313.   set demoQTstate to #play
  314.   updateStage()
  315. end
  316.  
  317. on memoryman1
  318.   preLoadCast(the number of cast "Gallery blur", the number of cast "QuickDraw Box")
  319. end
  320.  
  321. on mrUnloader1
  322.   put "Before unloading: The freebytes =" && string(the freeBytes) && "and the FreeBlock =" && string(the freeBlock)
  323.   unLoadCast(the number of cast "up tooth.pict", the number of cast "Gallery blur")
  324.   put "After unloading the freebytes =" && the freeBytes && "and the FreeBlock =" && the freeBlock
  325. end
  326.  
  327. on mrUnLoader2
  328.   unLoadCast(the number of cast "Binder Snap", the number of cast "Startup Loop 2.AIFF")
  329.   unLoadCast(the number of cast "PowerUp1", the number of cast "PowerUp12")
  330.   unLoadCast(the number of cast "GALLERY pic", the number of cast "RightHand 3")
  331. end
  332.  
  333. on enterFrame
  334.   if gPTimerSet then
  335.     if (the timer > (gPresentationTime * 3600)) and not gRedSet then
  336.       set gLightColor to "Red timer light lit"
  337.       set the castNum of sprite gPresentationLight to the number of cast gLightColor
  338.       set gRedSet to 1
  339.       exit
  340.     end if
  341.     if (the timer > ((gPresentationTime * 3600) - 7200)) and not gYellowSet then
  342.       set gLightColor to "Yellow timer light lit"
  343.       set the castNum of sprite gPresentationLight to the number of cast gLightColor
  344.       set gYellowSet to 1
  345.     end if
  346.   end if
  347. end
  348.