home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 17 / MacFormat 17 (Spain) / MacFormat 17.bin / DATABASE / SHARED.DIR / 01007.ls < prev    next >
Encoding:
Text File  |  1996-03-14  |  4.1 KB  |  158 lines

  1. on CheckCast
  2.   repeat with i = 1 to 999
  3.     if the depth of cast i > 8 then
  4.       put "whoops! cast " && i && " > 8 bit!!"
  5.     end if
  6.   end repeat
  7. end
  8.  
  9. on GetCaption
  10.   global gCurChap, gCurArticle, gCaptions
  11.   set the itemDelimiter to "@"
  12.   set tmp to item gCurChap of gCaptions
  13.   set the itemDelimiter to "#"
  14.   set tmp to item gCurArticle of tmp
  15.   set the itemDelimiter to ","
  16.   delete line 1 of tmp
  17.   set tmpchar to the number of chars in tmp
  18.   if char tmpchar of tmp = RETURN then
  19.     put "." into char tmpchar of tmp
  20.   end if
  21.   return tmp
  22. end
  23.  
  24. on UnloadMem
  25.   unLoad()
  26.   put "unloaded memory from everything except current frame. free=" && the freeBytes / 1024
  27. end
  28.  
  29. on CleanMem
  30.   global gCurPic
  31.   if gCurPic > 0 then
  32.     unLoad(gCurPic)
  33.     put "unloaded " && the name of cast gCurPic && " free=" && the freeBytes / 1024
  34.   end if
  35. end
  36.  
  37. on BlackScreen
  38.   global gMakerNum, gWorld, gnuggets
  39.   puppetSprite(47, 1)
  40.   set the castNum of sprite 47 to the number of cast "blackbox"
  41.   spriteBox(47, 0, 0, 640, 480)
  42.   set gMakerNum to value(gMakerNum)
  43.   set the text of field "strapline" to line gMakerNum of field "makersstraplines"
  44.   set the itemDelimiter to ","
  45.   delete item 1 of field "strapline"
  46.   ReadScript()
  47.   set the itemDelimiter to "."
  48.   set gWorld to item 1 of the movieName
  49.   set the itemDelimiter to ","
  50.   set tmpnum to the number of lines in field ("LoadingLines" & gWorld)
  51.   set the text of field "LoadingText" to line random(tmpnum) of field ("LoadingLines" & gWorld)
  52.   puppetSprite(48, 1)
  53.   set the castNum of sprite 48 to the number of cast "LoadingText"
  54.   set the locH of sprite 48 to 100
  55.   set the locV of sprite 48 to 150
  56. end
  57.  
  58. on UnBlackScreen
  59.   set the locH of sprite 47 to 2000
  60.   set the locH of sprite 48 to 2000
  61.   puppetSprite(48, 0)
  62.   puppetSprite(47, 0)
  63.   updateStage()
  64. end
  65.  
  66. on ClickSnd
  67.   global gClickSndCast
  68.   puppetSound(2, gClickSndCast)
  69.   TrapMouse()
  70. end
  71.  
  72. on TrapMouse
  73.   global gTrapStart
  74.   puppetSprite(46, 1)
  75.   set the castNum of sprite 46 to 1042
  76.   spriteBox(46, 0, 0, 640, 480)
  77.   updateStage()
  78. end
  79.  
  80. on EndTrapMouse
  81.   puppetSprite(46, 0)
  82. end
  83.  
  84. on ButtonClick
  85.   global gClickSndCast
  86.   ClickSnd()
  87.   updateStage()
  88.   set me to the clickOn
  89.   set myname to the name of cast the castNum of sprite me
  90.   set the itemDelimiter to "."
  91.   set myname to item 1 of myname
  92.   set the itemDelimiter to ","
  93.   puppetSprite(me, 1)
  94.   set myname to myname & ".down"
  95.   set the castNum of sprite me to the number of cast myname
  96.   updateStage()
  97.   puppetSprite(me, 0)
  98. end
  99.  
  100. on GetMapCap
  101.   global gMakerName, gMapCap, gCurMap
  102.   set the itemDelimiter to "#"
  103.   set num to the number of items in field "MapCaptions"
  104.   set the itemDelimiter to ","
  105.   set the text of field "caption-map" to " "
  106.   repeat with i = 1 to num
  107.     set the itemDelimiter to "#"
  108.     set gMapCap to item i of field "MapCaptions"
  109.     set the itemDelimiter to ","
  110.     if word 1 of gMapCap = gMakerName then
  111.       set gCurMap to 1
  112.       GetNextMapCap()
  113.       exit
  114.     end if
  115.   end repeat
  116.   set gMapCap to " "
  117. end
  118.  
  119. on GetNextMapCap
  120.   global gCurMap, gMapCap
  121.   set captionsprite to 18
  122.   set captionloch to the locH of sprite captionsprite
  123.   puppetSprite(captionsprite, 1)
  124.   set the locH of sprite captionsprite to 1000
  125.   updateStage()
  126.   set the itemDelimiter to "@"
  127.   set tmp to item gCurMap + 1 of gMapCap
  128.   delete line 1 to 2 of tmp
  129.   set the text of field "caption-map" to tmp
  130.   set the itemDelimiter to ","
  131.   set centerpoint to 265
  132.   set caph to the height of cast "caption-map"
  133.   set the locV of sprite captionsprite to centerpoint - (caph / 2)
  134.   set the locH of sprite captionsprite to captionloch
  135.   updateStage()
  136.   EndTrapMouse()
  137. end
  138.  
  139. on QTbuttonClick
  140.   global gQTbuttons, gQTloch, gQTstatus
  141.   NavButtonClose()
  142.   if the movieRate of sprite 16 then
  143.     puppetSprite(11, 1)
  144.     set the movieRate of sprite 16 to 0
  145.     set the castNum of sprite 11 to value(item 1 of gQTbuttons)
  146.     set gQTstatus to 0
  147.   else
  148.     puppetSprite(11, 1)
  149.     puppetSprite(16, 0)
  150.     if the movieTime of sprite 16 = the duration of cast "QTcast" then
  151.       set the movieTime of sprite 16 to 0
  152.     end if
  153.     set the movieRate of sprite 16 to 1
  154.     set the castNum of sprite 11 to value(item 2 of gQTbuttons)
  155.     set gQTstatus to 1
  156.   end if
  157. end
  158.