home *** CD-ROM | disk | FTP | other *** search
/ Adephia Powerlink / AdephiaPowerlink-030102.iso / mac / launchVT.dxr / 00001_Globals.ls next >
Encoding:
Text File  |  2001-03-30  |  7.6 KB  |  282 lines

  1. on startMovie
  2.   global gPcMatrix, gMacMatrix, gAuthorized, gAnswer, gButton, gPhoto, g1aName, g1bName, g1cName, g1dName, g1eName, g1fName, g2aName, g2bName, g2cName, g2dName, g2eName, g2fName, gtechName
  3.   clearGlobals()
  4.   gAuthorized = 0
  5.   repeat with spriteLoop = 6 to 25
  6.     sprite(spriteLoop).visible = 1
  7.   end repeat
  8.   getExternals()
  9.   newMAtrix()
  10.   ButtonConfig()
  11.   ButtonSet()
  12.   BuildMatrix()
  13. end
  14.  
  15. on ButtonSet
  16.   global g1aName, g1bName, g1cName, g1dName, g1eName, g1fName, g2aName, g2bName, g2cName, g2dName, g2eName, g2fName, gtechName
  17.   member("1a", 1).text = g1aName
  18.   if g1aName = EMPTY then
  19.     sprite(7).visible = 0
  20.   end if
  21.   if g1aName = EMPTY then
  22.     sprite(8).visible = 0
  23.   end if
  24.   member("1b", 1).text = g1bName
  25.   if g1bName = EMPTY then
  26.     sprite(9).visible = 0
  27.   end if
  28.   if g1bName = EMPTY then
  29.     sprite(10).visible = 0
  30.   end if
  31.   member("1c", 1).text = g1cName
  32.   if g1cName = EMPTY then
  33.     sprite(11).visible = 0
  34.   end if
  35.   if g1cName = EMPTY then
  36.     sprite(12).visible = 0
  37.   end if
  38.   member("1d", 1).text = g1dName
  39.   if g1dName = EMPTY then
  40.     sprite(13).visible = 0
  41.   end if
  42.   if g1dName = EMPTY then
  43.     sprite(14).visible = 0
  44.   end if
  45.   member("1e", 1).text = g1eName
  46.   if g1eName = EMPTY then
  47.     sprite(15).visible = 0
  48.   end if
  49.   if g1eName = EMPTY then
  50.     sprite(16).visible = 0
  51.   end if
  52.   member("1f", 1).text = g1fName
  53.   if g1fName = EMPTY then
  54.     sprite(17).visible = 0
  55.   end if
  56.   if g1fName = EMPTY then
  57.     sprite(18).visible = 0
  58.   end if
  59.   member("2a", 1).text = g2aName
  60.   if g2aName = EMPTY then
  61.     sprite(19).visible = 0
  62.   end if
  63.   member("2b", 1).text = g2bName
  64.   if g2bName = EMPTY then
  65.     sprite(20).visible = 0
  66.   end if
  67.   member("2c", 1).text = g2cName
  68.   if g2cName = EMPTY then
  69.     sprite(21).visible = 0
  70.   end if
  71.   member("2d", 1).text = g2dName
  72.   if g2dName = EMPTY then
  73.     sprite(22).visible = 0
  74.   end if
  75.   member("2e", 1).text = g2eName
  76.   if g2eName = EMPTY then
  77.     sprite(23).visible = 0
  78.   end if
  79.   member("2f", 1).text = g2fName
  80.   if g2fName = EMPTY then
  81.     sprite(24).visible = 0
  82.   end if
  83.   member("technician", 1).text = gtechName
  84.   if gtechName = EMPTY then
  85.     sprite(25).visible = 0
  86.   end if
  87. end
  88.  
  89. on getExternals
  90.   if the machineType = 256 then
  91.     background = the moviePath & "external" & "\" & "backgrnd.bmp"
  92.     xbmp = the moviePath & "external" & "\" & "x.bmp"
  93.     abmp = the moviePath & "external" & "\" & "a.bmp"
  94.     bbmp = the moviePath & "external" & "\" & "b.bmp"
  95.     cbmp = the moviePath & "external" & "\" & "c.bmp"
  96.     dbmp = the moviePath & "external" & "\" & "d.bmp"
  97.     ebmp = the moviePath & "external" & "\" & "e.bmp"
  98.     fbmp = the moviePath & "external" & "\" & "f.bmp"
  99.     title1Copy = the moviePath & "external" & "\" & "1title.rtf"
  100.     title2Copy = the moviePath & "external" & "\" & "2title.rtf"
  101.     text1Copy = the moviePath & "external" & "\" & "1text.rtf"
  102.     text2Copy = the moviePath & "external" & "\" & "2text.rtf"
  103.     quitCopy = the moviePath & "external" & "\" & "quittext.rtf"
  104.     matrixCopy = the moviePath & "external" & "\" & "matrixScript.rtf"
  105.   else
  106.     background = the moviePath & "external" & ":" & "backgrnd.bmp"
  107.     xbmp = the moviePath & "external" & ":" & "x.bmp"
  108.     abmp = the moviePath & "external" & ":" & "a.bmp"
  109.     bbmp = the moviePath & "external" & ":" & "b.bmp"
  110.     cbmp = the moviePath & "external" & ":" & "c.bmp"
  111.     dbmp = the moviePath & "external" & ":" & "d.bmp"
  112.     ebmp = the moviePath & "external" & ":" & "e.bmp"
  113.     fbmp = the moviePath & "external" & ":" & "f.bmp"
  114.     title1Copy = the moviePath & "external" & ":" & "1title.rtf"
  115.     title2Copy = the moviePath & "external" & ":" & "2title.rtf"
  116.     text1Copy = the moviePath & "external" & ":" & "1text.rtf"
  117.     text2Copy = the moviePath & "external" & ":" & "2text.rtf"
  118.     quitCopy = the moviePath & "external" & ":" & "quittext.rtf"
  119.     matrixCopy = the moviePath & "external" & ":" & "matrixScript.rtf"
  120.   end if
  121.   importFileInto(member("x"), xbmp)
  122.   importFileInto(member("a"), abmp)
  123.   importFileInto(member("b"), bbmp)
  124.   importFileInto(member("c"), cbmp)
  125.   importFileInto(member("d"), dbmp)
  126.   importFileInto(member("e"), ebmp)
  127.   importFileInto(member("f"), fbmp)
  128.   importFileInto(member("backgrnd"), background)
  129.   importFileInto(member("1title"), title1Copy)
  130.   importFileInto(member("2title"), title2Copy)
  131.   importFileInto(member("1text"), text1Copy)
  132.   importFileInto(member("2text"), text2Copy)
  133.   importFileInto(member("quittext"), quitCopy)
  134.   importFileInto(member("matrixScript"), matrixCopy)
  135. end
  136.  
  137. on newMAtrix
  138.   newMember = new(#script, member(13, "Internal"))
  139.   newMember.name = "matrix"
  140.   newMember.scriptType = #movie
  141.   newMember.scriptText = member("matrixScript").text
  142. end
  143.  
  144. on BuildMatrix
  145.   buildPCMatrix()
  146.   buildMacMatrix()
  147. end
  148.  
  149. on DisplayProduct
  150.   global gPhoto
  151. end
  152.  
  153. on RecordAnswer1
  154.   global gButton, gAnswer
  155.   if voidp(gButton) then
  156.     return 
  157.   else
  158.     if gButton contains "1a" then
  159.       go("credit")
  160.       gAnswer = gButton
  161.       OpenVTruck(gAnswer)
  162.       quit()
  163.     else
  164.       if gButton contains "1b" then
  165.         gAnswer = gButton
  166.         OpenDoc(gAnswer)
  167.         gButton = EMPTY
  168.         go("question2")
  169.       end if
  170.     end if
  171.   end if
  172. end
  173.  
  174. on RecordAnswer2
  175.   global gButton, gAnswer
  176.   if voidp(gButton) then
  177.     return 
  178.   else
  179.     if gButton contains "2a" then
  180.       put gAnswer
  181.       checkAuthorization()
  182.       go("credit")
  183.       OpenVTruck(gAnswer)
  184.       quit()
  185.     else
  186.       if gButton contains "2b" then
  187.         go("credit")
  188.         quit()
  189.       end if
  190.     end if
  191.   end if
  192. end
  193.  
  194. on checkAuthorization
  195.   global gAuthorized, gAnswer
  196.   if gAuthorized = 0 then
  197.     exit
  198.   else
  199.     authorized = gAnswer
  200.     gAnswer = "t" & authorized
  201.     put gAnswer
  202.   end if
  203. end
  204.  
  205. on OpenVTruck gAnswer
  206.   global gAnswer, gMatrix
  207.   folderName = "Adelphia"
  208.   if voidp(folderName) then
  209.     return 
  210.   else
  211.     if the machineType = 256 then
  212.       theFile = the moviePath & folderName & "\" & "Adelphia.exe"
  213.       put theFile
  214.       open(theFile)
  215.     else
  216.       theFile = the moviePath & folderName & ":" & "Adelphia"
  217.       put theFile
  218.       open(theFile)
  219.     end if
  220.   end if
  221. end
  222.  
  223. on OpenDoc gAnswer
  224.   global gAnswer, gMatrix, id
  225.   folderName = "Docs"
  226.   if voidp(folderName) then
  227.     return 
  228.   else
  229.     if the machineType = 256 then
  230.       id = freeReadRegString("SOFTWARE\Adobe\Acrobat Reader\4.0\Language", "UI", "temp", "HKEY_LOCAL_MACHINE")
  231.       if id <> "temp" then
  232.         theFile = the moviePath & folderName & "\" & "openfile.exe"
  233.         put theFile
  234.         open(theFile)
  235.       else
  236.         theInstaller = the moviePath & folderName & "\" & "launchs.exe"
  237.         put theInstaller
  238.         open(theInstaller)
  239.         repeat while id = "temp"
  240.           startTimer()
  241.           repeat while the timer < 600
  242.           end repeat
  243.           id = freeReadRegString("SOFTWARE\Adobe\Acrobat Reader\4.0\Language", "UI", "temp", "HKEY_LOCAL_MACHINE")
  244.         end repeat
  245.         theFile = the moviePath & folderName & "\" & "openfile.exe"
  246.         put theFile
  247.         open(theFile)
  248.       end if
  249.     else
  250.       theFile = the moviePath & folderName & ":" & "viewdoc2"
  251.       put theFile
  252.       open(theFile)
  253.     end if
  254.   end if
  255. end
  256.  
  257. on returnTO
  258.   global gButton, gAnswer
  259.   answerCheck = the number of chars in gAnswer
  260.   if (gButton contains "1") and (answerCheck = "2") then
  261.   else
  262.     if (gButton contains "1") and (answerCheck = "4") then
  263.     else
  264.       if (gButton contains "2") and (answerCheck = "2") then
  265.         temp2Answer = char 1 to 2 of gAnswer
  266.         gAnswer = temp2Answer & gButton
  267.         put gAnswer
  268.       else
  269.         if (gButton contains "2") and (answerCheck = "4") then
  270.           temp2Answer = char 1 to 2 of gAnswer
  271.           gAnswer = temp2Answer & gButton
  272.           put gAnswer
  273.         end if
  274.       end if
  275.     end if
  276.   end if
  277. end
  278.  
  279. on quitProgram
  280.   quit()
  281. end
  282.