home *** CD-ROM | disk | FTP | other *** search
/ The Weather Channel - Everything Weather / TheWeatherChannel-EverythingWeather-Win31.iso / twcia / hurrican / hurrican.dxr / 00014.ls < prev    next >
Encoding:
Text File  |  1995-08-22  |  6.4 KB  |  206 lines

  1. on startMovie
  2.   global linkString, backString, photoFiles, textFiles, videoFiles, movieLocation, indexString, CDPath, photoNumber, textNumber, videoNumber, currentLine, subTopicNames
  3.   set the floatPrecision to 2
  4.   set the directToStage of cast 32 to 1
  5.   set the visible of sprite 15 to 0
  6.   puppetSprite(15, 1)
  7.   puppetSprite(10, 1)
  8.   set the visible of sprite 43 to 0
  9.   globalButtonInit(45, 48)
  10.   set subTopicNames to "hbasics,insideh,cyclones,htrack,uhurricn,hsafe"
  11.   puppetSprite(8, 1)
  12.   set the mouseDownScript to "click"
  13.   if (linkString = EMPTY) or (linkString = "hurrican 0 0 0 0") then
  14.     set movieLocation to "hurrican 0 0 0 0"
  15.   else
  16.     set movieLocation to linkString
  17.     setLink()
  18.   end if
  19. end
  20.  
  21. on click
  22.   if the clickOn then
  23.     puppetSound("click1.aif")
  24.     updateStage()
  25.     puppetSound(0)
  26.   end if
  27. end
  28.  
  29. on stopMovie
  30.   puppetSprite(15, 0)
  31.   puppetSprite(26, 0)
  32.   repeat with i = 2 to 8
  33.     puppetSprite(i, 0)
  34.   end repeat
  35.   puppetSprite(38, 0)
  36. end
  37.  
  38. on videoLoad
  39.   global start, duration, ratio, videoNumber, videoFiles
  40.   if item 1 of videoFiles contains "*" then
  41.   else
  42.     unLoadCast(32)
  43.     set the fileName of cast 32 to item 1 of line videoNumber of videoFiles
  44.     set the text of field "vcounter" to videoNumber && "of" && the number of lines in videoFiles - 1
  45.     set the locH of sprite 28 to start
  46.     set duration to float(the duration of cast 32)
  47.     set ratio to the width of sprite 27 / duration
  48.     set the locH of sprite 28 to start + (the movieTime of sprite 16 * ratio)
  49.     set the castNum of sprite 28 to 131
  50.     set the text of field "videoTitle" to item 2 to 3 of line videoNumber of videoFiles
  51.   end if
  52. end
  53.  
  54. on loadControlFiles file
  55.   global photoFiles, textFiles, videoFiles, CDPath
  56.   set theFile to CDPath & "hurrican\" & file & ".pcf"
  57.   set obj to FileIO(mnew, "read", theFile)
  58.   if not objectp(obj) then
  59.     alert("cant load " && theFile)
  60.   else
  61.     set photoFiles to obj(mReadFile)
  62.     obj(mdispose)
  63.   end if
  64.   set theFile to CDPath & "hurrican\" & file & ".tcf"
  65.   set obj to FileIO(mnew, "read", theFile)
  66.   if not objectp(obj) then
  67.     alert("cant load " && theFile)
  68.   else
  69.     set textFiles to obj(mReadFile)
  70.     obj(mdispose)
  71.   end if
  72.   set theFile to CDPath & "hurrican\" & file & ".vcf"
  73.   set obj to FileIO(mnew, "read", theFile)
  74.   if not objectp(obj) then
  75.     alert("cant load " && theFile)
  76.   else
  77.     set videoFiles to obj(mReadFile)
  78.     obj(mdispose)
  79.     if videoFiles contains "*" then
  80.       set the castNum of sprite 10 to 148
  81.     else
  82.       set the castNum of sprite 10 to 130
  83.     end if
  84.   end if
  85. end
  86.  
  87. on setUpTypes controlFileName
  88.   global photoFiles, photoNumber, videoFiles, videoNumber, textNumber, textFiles, textCast, currentLine, subTopicNames
  89.   set photoNumber to 1
  90.   set videoNumber to 1
  91.   set textNumber to 1
  92.   set currentLine to 9
  93.   loadControlFiles(controlFileName)
  94.   set the text of field "counter" to photoNumber && "of" && the number of lines in photoFiles - 1
  95.   set the text of field "vcounter" to videoNumber && "of" && the number of lines in videoFiles - 1
  96.   set the text of field "tcounter" to textNumber && "of" && the number of lines in textFiles - 1
  97.   set the fileName of cast 31 to item 1 of line 1 of photoFiles
  98.   if item 1 of videoFiles contains "*" then
  99.   else
  100.     unLoadCast(32)
  101.     set the fileName of cast 32 to item 1 of line 1 of videoFiles
  102.     set the text of field "videoTitle" to item 2 to 3 of line videoNumber of videoFiles
  103.   end if
  104.   set textCast to the number of cast item 1 of line textNumber of textFiles
  105.   set the castNum of sprite 15 to textCast
  106.   set x to offset(controlFileName, subTopicNames)
  107.   set i to the number of items in char 1 to x of subTopicNames
  108.   set the castNum of sprite 8 to 17 + i
  109.   set the text of field "credits" to item 2 to 3 of line photoNumber of photoFiles
  110.   set the text of field "articleTitle" to item 2 to 3 of line textNumber of textFiles
  111. end
  112.  
  113. on resetSprites
  114.   set lastChannel to 0
  115.   set the castNum of sprite 8 to 17
  116.   set the castNum of sprite 10 to 3
  117.   set the visible of sprite 15 to 0
  118.   puppetSprite(26, 0)
  119.   puppetSprite(28, 0)
  120.   puppetSprite(38, 0)
  121.   puppetSprite(44, 0)
  122.   set the cursor of sprite 14 to 0
  123.   if the castNum of sprite 16 = 32 then
  124.     set the movieRate of sprite 16 to 0
  125.   end if
  126.   unLoadCast(32, 32)
  127.   put "0" into word 2 of movieLocation
  128. end
  129.  
  130. on setLink
  131.   global subTopicNames, photoNumber, photoFiles, textNumber, currentLine, linkString, videoNumber, videoFiles, CDPath, backString, movieLocation, textFiles, OnLinePath, calPath, textCast
  132.   if word 1 of linkString <> "hurrican" then
  133.     cleanUp()
  134.     set name to word 1 of linkString
  135.     unLoadCast()
  136.     if name = "climate" then
  137.       go(value(word 2 of linkString), CDPath & name & "\" & name)
  138.     else
  139.       go(1, CDPath & name & "\" & name)
  140.     end if
  141.     exit
  142.   end if
  143.   if word 2 of linkString = "0" then
  144.     go(3)
  145.     exit
  146.   end if
  147.   set file to item value(word 2 of linkString) of subTopicNames
  148.   setUpTypes(file)
  149.   if word 3 of linkString = 1 then
  150.     set photoNumber to value(word 4 of linkString)
  151.     set the fileName of cast 31 to item 1 of line photoNumber of photoFiles
  152.     go("photo")
  153.     exit
  154.   else
  155.     if word 3 of linkString = 2 then
  156.       set textNumber to value(word 4 of linkString)
  157.       set currentLine to value(word 5 of linkString)
  158.       set the text of field "articleTitle" to item 2 to 3 of line textNumber of textFiles
  159.       set textCast to the number of cast item 1 of line textNumber of textFiles
  160.       set the castNum of sprite 15 to textCast
  161.       set the visible of sprite 15 to 1
  162.       go("text")
  163.       exit
  164.     else
  165.       if word 3 of linkString = 3 then
  166.         set videoNumber to value(word 4 of linkString)
  167.         if item 1 of videoFiles contains "*" then
  168.           no(video)
  169.         else
  170.           unLoadCast(32)
  171.           set the fileName of cast 32 to item 1 of line videoNumber of videoFiles
  172.           set the text of field "videoTitle" to item 2 to 3 of line videoNumber of videoFiles
  173.         end if
  174.         go("video")
  175.       end if
  176.     end if
  177.   end if
  178. end
  179.  
  180. on clearPuppets
  181.   puppetSprite(38, 0)
  182.   set the visible of sprite 15 to 0
  183.   puppetSprite(26, 0)
  184.   puppetSprite(28, 0)
  185.   puppetSprite(44, 0)
  186. end
  187.  
  188. on cleanUp
  189.   global CDPath, HDPath, calPath, OnLinePath, linkString, backString, linkFlag
  190.   set temp1 to CDPath
  191.   set temp2 to HDPath
  192.   set temp3 to linkString
  193.   set temp4 to backString
  194.   set temp5 to calPath
  195.   set temp6 to OnLinePath
  196.   set temp7 to linkFlag
  197.   clearGlobals()
  198.   set CDPath to temp1
  199.   set HDPath to temp2
  200.   set linkString to temp3
  201.   set backString to temp4
  202.   set calPath to temp5
  203.   set OnLinePath to temp6
  204.   set linkFlag to temp7
  205. end
  206.