home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 6 / MacAddict_006_1997_02.iso / media / ThisIssue.Dxr / Internal_6.ls < prev    next >
Encoding:
Text File  |  1996-11-22  |  7.7 KB  |  251 lines

  1. on startMovie
  2.   global knob, dbase, modality
  3.   setControls(0)
  4.   set dbase to new(script "databaseClass", "databaseText")
  5.   set knob to new(script "knobClass", "knob", count(getsections(dbase)), "knobaction")
  6.   showfiles(1, 1)
  7.   set the scrollTop of member "files" to 0
  8.   set the scrollTop of member "articles" to 0
  9.   resetThumb("filethumb")
  10.   resetThumb("articlethumb")
  11.   set the visible of sprite castspritea("installbtn") to 0
  12.   setvolume(15)
  13.   set modality to 0
  14. end
  15.  
  16. on knobaction whichstate
  17.   puppetSound(2, 0)
  18.   puppetSound(2, "switch")
  19.   showfiles(whichstate, 1)
  20.   cyclelights(3)
  21. end
  22.  
  23. on cyclelights numtimes
  24.   repeat with whichcycle = 1 to numtimes
  25.     if not soundBusy(2) then
  26.       puppetSound(2, 0)
  27.       puppetSound(2, "Visor Hum Loop")
  28.     end if
  29.     repeat with index = 1 to 3
  30.       startTimer()
  31.       repeat with query = 1 to 3
  32.         set the visible of sprite castsprite("light" & string(query)) to query = index
  33.         updateStage()
  34.       end repeat
  35.       repeat while the timer < 6
  36.         if the mouseDown then
  37.           puppetSound(2, 0)
  38.           repeat with index = 1 to 3
  39.             set the visible of sprite castsprite("light" & string(index)) to 0
  40.             updateStage()
  41.           end repeat
  42.           puppetSound(2, 0)
  43.           exit repeat
  44.         end if
  45.       end repeat
  46.     end repeat
  47.     repeat with index = 1 to 3
  48.       set the visible of sprite castsprite("light" & string(index)) to 0
  49.       updateStage()
  50.     end repeat
  51.   end repeat
  52.   puppetSound(2, 0)
  53. end
  54.  
  55. on showfiles section, article
  56.   global dbase
  57.   set headerlist to getsections(dbase)
  58.   if not voidp(section) then
  59.     set the activesection of dbase to getAt(headerlist, section)
  60.   end if
  61.   put the activesection of dbase into field "header"
  62.   set articlelist to getCategories(dbase)
  63.   if not voidp(article) then
  64.     set the activecategory of dbase to getAt(articlelist, article)
  65.   end if
  66.   set buffer to the activesection of dbase & RETURN
  67.   set buffer to buffer & listtotext(articlelist, RETURN & RETURN)
  68.   if buffer <> the text of field "articles" then
  69.     set the textFont of line 1 of field "articles" to "Geneva"
  70.     put buffer into field "articles"
  71.     set the textFont of line 1 of field "articles" to "Chicago"
  72.   end if
  73.   set filelist to getrecords(dbase)
  74.   set buffer to the activecategory of dbase & RETURN
  75.   set buffer to buffer & listtotext(filelist, RETURN)
  76.   if buffer <> the text of field "files" then
  77.     set the textFont of line 1 of field "files" to "Geneva"
  78.     put buffer into field "files"
  79.     set the textFont of line 1 of field "files" to "Chicago"
  80.   end if
  81.   set the activerec of dbase to getrecord(dbase, getAt(filelist, 1))
  82. end
  83.  
  84. on idle
  85.   global gvoxlist
  86.   if random(10000) = 500 then
  87.     if not listp(gvoxlist) then
  88.       set gvoxlist to []
  89.     end if
  90.     if count(gvoxlist) = 0 then
  91.       repeat with index = 1 to 6
  92.         add(gvoxlist, index)
  93.       end repeat
  94.       repeat with index = 1 to 6
  95.         set r to random(6)
  96.         set t to getAt(gvoxlist, r)
  97.         setAt(gvoxlist, r, getAt(gvoxlist, index))
  98.         setAt(gvoxlist, index, t)
  99.       end repeat
  100.     end if
  101.     set curvox to getAt(gvoxlist, 1)
  102.     deleteAt(gvoxlist, 1)
  103.     set the visible of sprite castsprite("speaker") to 1
  104.     updateStage()
  105.     cyclelights(1)
  106.     puppetSound(3, 0)
  107.     puppetSound(3, "Vox" & string(curvox))
  108.     repeat while soundBusy(3)
  109.       set the visible of sprite castsprite("speaker") to not (the visible of sprite castsprite("speaker"))
  110.       updateStage()
  111.       cyclelights(1)
  112.       if the mouseDown then
  113.         exit repeat
  114.       end if
  115.     end repeat
  116.     set the visible of sprite castsprite("speaker") to 0
  117.     updateStage()
  118.   end if
  119. end
  120.  
  121. on setControls state
  122.   puppetSound(2, 0)
  123.   if state then
  124.     puppetSound(2, "blooip")
  125.   else
  126.     puppetSound(2, "pioolb")
  127.   end if
  128.   set btnlist to ["controls", "backbtn", "menubtn", "infobtn", "quitbtn", "audiothumb"]
  129.   repeat with ctrl in btnlist
  130.     set the visible of sprite castsprite(ctrl) to state
  131.   end repeat
  132. end
  133.  
  134. on showLaunchDlg
  135.   global dbase, modality
  136.   puppetSound(2, 0)
  137.   puppetSound(2, "blooip")
  138.   set dlgsprite to castspritea("null")
  139.   puppetSprite(dlgsprite, 1)
  140.   set the memberNum of sprite dlgsprite to the number of member "Warning"
  141.   set urlbtn to castspritea("null")
  142.   puppetSprite(urlbtn, 1)
  143.   set the memberNum of sprite urlbtn to the number of member "launchURL"
  144.   if the url of the activerec of dbase <> "n/a" then
  145.     set the visible of sprite urlbtn to 0
  146.   end if
  147.   set launchbtn to castspritea("null")
  148.   puppetSprite(launchbtn, 1)
  149.   set the memberNum of sprite launchbtn to the number of member "InstallAppBtn"
  150.   set infotext to castspritea("null")
  151.   puppetSprite(infotext, 1)
  152.   set the memberNum of sprite infotext to the number of member "ContactInfo"
  153.   set rec to the activerec of dbase
  154.   set the text of field "ContactInfo" to outsafeput(the contact of rec)
  155.   set the loc of sprite infotext to point(161, 247)
  156.   updateStage()
  157.   set modality to 1
  158. end
  159.  
  160. on HideLaunchDlg
  161.   global dbase, modality
  162.   set dlgsprite to castspritea("Warning")
  163.   puppetSprite(dlgsprite, 1)
  164.   set the memberNum of sprite dlgsprite to the number of member "null"
  165.   set urlbtn to castspritea("launchURL")
  166.   puppetSprite(urlbtn, 1)
  167.   set the memberNum of sprite urlbtn to the number of member "null"
  168.   if the url of the activerec of dbase <> "n/a" then
  169.     set the visible of sprite urlbtn to 1
  170.   end if
  171.   set launchbtn to castspritea("InstallAppBtn")
  172.   puppetSprite(launchbtn, 1)
  173.   set the memberNum of sprite launchbtn to the number of member "null"
  174.   set infotext to castspritea("ContactInfo")
  175.   puppetSprite(infotext, 1)
  176.   set the memberNum of sprite infotext to the number of member "null"
  177.   set the text of field "ContactInfo" to " "
  178.   updateStage()
  179.   puppetSprite(dlgsprite, 0)
  180.   puppetSprite(urlbtn, 0)
  181.   puppetSprite(launchbtn, 0)
  182.   puppetSprite(infotext, 0)
  183.   set modality to 0
  184. end
  185.  
  186. on launchURL
  187.   puppetSound(2, 0)
  188.   puppetSound(2, "launchURLSound")
  189. end
  190.  
  191. on launchApp myfilepath
  192.   global dbase
  193.   puppetSound(2, 0)
  194.   puppetSound(2, "launchAppSound")
  195.   if castspritea("password") then
  196.     HidePasswordDlg()
  197.     if the text of member "passwordtext" = "frag1le" then
  198.       loadfile(dbase)
  199.     end if
  200.   else
  201.     open(myfilepath)
  202.   end if
  203. end
  204.  
  205. on ShowPasswordDlg
  206.   global dbase, modality
  207.   puppetSound(2, 0)
  208.   puppetSound(2, "blooip")
  209.   set dlgsprite to castspritea("null")
  210.   puppetSprite(dlgsprite, 1)
  211.   set the memberNum of sprite dlgsprite to the number of member "Password"
  212.   set urlbtn to castspritea("null")
  213.   puppetSprite(urlbtn, 1)
  214.   set the memberNum of sprite urlbtn to the number of member "launchURL"
  215.   set the visible of sprite urlbtn to 0
  216.   set launchbtn to castspritea("null")
  217.   puppetSprite(launchbtn, 1)
  218.   set the memberNum of sprite launchbtn to the number of member "InstallAppBtn"
  219.   set infotext to castspritea("null")
  220.   puppetSprite(infotext, 1)
  221.   set the memberNum of sprite infotext to the number of member "passwordtext"
  222.   set rec to the activerec of dbase
  223.   set the text of field "passwordtext" to outsafeput(the contact of rec)
  224.   set the loc of sprite infotext to point(161, 247)
  225.   updateStage()
  226.   set modality to 1
  227. end
  228.  
  229. on HidePasswordDlg
  230.   global modality
  231.   set dlgsprite to castspritea("Password")
  232.   puppetSprite(dlgsprite, 1)
  233.   set the memberNum of sprite dlgsprite to the number of member "null"
  234.   set urlbtn to castspritea("launchURL")
  235.   puppetSprite(urlbtn, 1)
  236.   set the memberNum of sprite urlbtn to the number of member "null"
  237.   set the visible of sprite urlbtn to 1
  238.   set launchbtn to castspritea("InstallAppBtn")
  239.   puppetSprite(launchbtn, 1)
  240.   set the memberNum of sprite launchbtn to the number of member "null"
  241.   set infotext to castspritea("passwordtext")
  242.   puppetSprite(infotext, 1)
  243.   set the memberNum of sprite infotext to the number of member "null"
  244.   set the text of field "ContactInfo" to " "
  245.   updateStage()
  246.   puppetSprite(dlgsprite, 0)
  247.   puppetSprite(launchbtn, 0)
  248.   puppetSprite(infotext, 0)
  249.   set modality to 0
  250. end
  251.