home *** CD-ROM | disk | FTP | other *** search
/ Dictionnaire Multimedia Multilingue (Home PC 42) / dictionarvizual.iso / data / germnumb.dir / 00040.ls < prev    next >
Encoding:
Text File  |  1996-03-13  |  7.3 KB  |  243 lines

  1. global moused, gAct, txFront, txBackSin, txBackDbl, gtxtSw1, gtxtSw2, gLang1, gLang2, txFrSmall, txFrMed, txFrBig, l1Text, gFlash, gvpointer, gPrompt, wSprite, gfDelim, gRoot, gBox, gwaLanLst, glObj, gCursor
  2.  
  3. on enterFrame
  4.   global gAct, gLastSp
  5.   repeat with i = 2 to 7
  6.     set the ink of sprite i to 0
  7.   end repeat
  8.   if gFlash > 0 then
  9.     if gFlash = 1 then
  10.       playWave(getAt(gwaLanLst, 1), "m")
  11.     end if
  12.     set sp to wSprite + 6
  13.     set the ink of sprite sp to 2
  14.     set the visible of sprite sp to 1
  15.     updateStage()
  16.     waitTicks(60)
  17.     set the visible of sprite sp to 0
  18.     updateStage()
  19.     waitTicks(60)
  20.     set gFlash to gFlash - 1
  21.   else
  22.     if gPrompt = 2 then
  23.       set gPrompt to 1
  24.       set gpromptObj to 0
  25.       RndWord()
  26.       playWave(getAt(gwaLanLst, 1), "p")
  27.     else
  28.       if gPrompt = 1 then
  29.         set gPrompt to 0
  30.         playWave(getAt(gwaLanLst, 1), "p")
  31.       end if
  32.     end if
  33.   end if
  34. end
  35.  
  36. on exitFrame
  37.   go(the frame)
  38. end
  39.  
  40. on mouseDown
  41.   global HDdir, gRoot, gfDelim
  42.   if gCursor = 0 then
  43.     exit
  44.   end if
  45.   set vLang to gLang2
  46.   set gLang2 to 3
  47.   if the mouseCast = 32 then
  48.     set the visible of sprite 38 to 1
  49.     set the ink of sprite 38 to 2
  50.     updateStage()
  51.     waitTicks(15)
  52.     set the visible of sprite 38 to 0
  53.     updateStage()
  54.     sound playFile 1, gRoot & "0" & gfDelim & "onethou"
  55.   end if
  56.   if the mouseCast = 33 then
  57.     set the visible of sprite 39 to 1
  58.     set the ink of sprite 39 to 2
  59.     updateStage()
  60.     waitTicks(15)
  61.     set the visible of sprite 39 to 0
  62.     updateStage()
  63.     sound playFile 1, gRoot & "0" & gfDelim & "tenthou"
  64.   end if
  65.   if the mouseCast = 34 then
  66.     set the visible of sprite 40 to 1
  67.     set the ink of sprite 40 to 2
  68.     updateStage()
  69.     waitTicks(15)
  70.     set the visible of sprite 40 to 0
  71.     updateStage()
  72.     sound playFile 1, gRoot & "0" & gfDelim & "onehuth"
  73.   end if
  74.   if the mouseCast = 35 then
  75.     set the visible of sprite 41 to 1
  76.     set the ink of sprite 41 to 2
  77.     updateStage()
  78.     waitTicks(15)
  79.     set the visible of sprite 41 to 0
  80.     updateStage()
  81.     sound playFile 1, gRoot & "0" & gfDelim & "onemill"
  82.   end if
  83.   if the mouseCast = 36 then
  84.     set the visible of sprite 42 to 1
  85.     set the ink of sprite 42 to 2
  86.     updateStage()
  87.     waitTicks(15)
  88.     set the visible of sprite 42 to 0
  89.     updateStage()
  90.     sound playFile 1, gRoot & "0" & gfDelim & "zero"
  91.   end if
  92.   set mV to the mouseV
  93.   set mH to the mouseH
  94.   set moused to the mouseCast + 6
  95.   if (the mouseCast < 2) or (the mouseCast > 31) then
  96.     set gLang2 to vLang
  97.     exit
  98.   end if
  99.   set the ink of sprite moused to 2
  100.   set the visible of sprite moused to 1
  101.   updateStage()
  102.   waitTicks(15)
  103.   set the visible of sprite moused to 0
  104.   updateStage()
  105.   if gAct = "f" then
  106.   else
  107.     set gCursor to 0
  108.     cursor(4)
  109.     repeat with i = 8 to 45
  110.       set the cursor of sprite i to 4
  111.     end repeat
  112.     updateStage()
  113.     if ((moused - 8) > 0) and ((moused - 8) <= count(glObj)) then
  114.       set thePointer to getAt(glObj, moused - 8)
  115.       put "pointer" && thePointer
  116.     else
  117.       set thePointer to 0
  118.       if the mouseCast = 2 then
  119.         puppetSound("zero")
  120.       end if
  121.     end if
  122.     if thePointer > 0 then
  123.       if objectp(gLanDta) then
  124.         gLanDta(mdispose)
  125.       end if
  126.       set gLanDta to FileIO(mnew, "read", HDdir & "wa_lan.dta")
  127.       set g to gLanDta(mSetPosition, getAt(gwaLanDp, thePointer))
  128.       set gwaLanLst to []
  129.       repeat with i = 1 to 5
  130.         set theText to gLanDta(mReadToken, "|", "|")
  131.         append(gwaLanLst, theText)
  132.       end repeat
  133.       set the regPoint of cast txBackSin to point(0, 0)
  134.       set the regPoint of cast txBackDbl to point(0, 0)
  135.       set words1 to getAt(gwaLanLst, gLang1 + 2)
  136.       set words2 to getAt(gwaLanLst, gLang2 + 2)
  137.       if gtxtSw1 and gtxtSw2 then
  138.         if length(words1) > length(words2) then
  139.           set bigger to length(words1)
  140.         else
  141.           set bigger to length(words2)
  142.         end if
  143.         set the castNum of sprite 46 to txBackDbl
  144.         if bigger < 13 then
  145.           set the text of cast txFrSmall to words1 & RETURN & words2
  146.           set the castNum of sprite 47 to txFrSmall
  147.           set the rect of sprite 46 to the rect of cast txFrSmall
  148.         else
  149.           if bigger < 25 then
  150.             set the text of cast txFrMed to words1 & RETURN & words2
  151.             set the castNum of sprite 47 to txFrMed
  152.             set the rect of sprite 46 to the rect of cast txFrMed
  153.           else
  154.             set the text of cast txFrBig to words1 & RETURN & words2
  155.             set the castNum of sprite 47 to txFrBig
  156.             set the rect of sprite 46 to the rect of cast txFrBig
  157.           end if
  158.         end if
  159.       else
  160.         if gtxtSw1 then
  161.           set bigger to length(words1)
  162.           set the castNum of sprite 46 to txBackSin
  163.           if bigger < 13 then
  164.             set the text of cast txFrSmall to words1
  165.             set the castNum of sprite 47 to txFrSmall
  166.             set the rect of sprite 46 to the rect of cast txFrSmall
  167.           else
  168.             if bigger < 25 then
  169.               set the text of cast txFrMed to words1
  170.               set the castNum of sprite 47 to txFrMed
  171.               set the rect of sprite 46 to the rect of cast txFrMed
  172.             else
  173.               set the text of cast txFrBig to words1
  174.               set the castNum of sprite 47 to txFrBig
  175.               set the rect of sprite 46 to the rect of cast txFrBig
  176.             end if
  177.           end if
  178.         else
  179.           if gtxtSw2 then
  180.             set bigger to length(words2)
  181.             set the castNum of sprite 46 to txBackSin
  182.             if bigger < 13 then
  183.               set the text of cast txFrSmall to words2
  184.               set the castNum of sprite 47 to txFrSmall
  185.               set the rect of sprite 46 to the rect of cast txFrSmall
  186.             else
  187.               if bigger < 25 then
  188.                 set the text of cast txFrMed to words2
  189.                 set the castNum of sprite 47 to txFrMed
  190.                 set the rect of sprite 46 to the rect of cast txFrMed
  191.               else
  192.                 set the text of cast txFrBig to words2
  193.                 set the castNum of sprite 47 to txFrBig
  194.                 set the rect of sprite 46 to the rect of cast txFrBig
  195.               end if
  196.             end if
  197.           end if
  198.         end if
  199.       end if
  200.       if mH > 320 then
  201.         set a to mH - the width of sprite 46
  202.         if a < 0 then
  203.           set the locH of sprite 46 to 0
  204.         else
  205.           set the locH of sprite 46 to a
  206.         end if
  207.       else
  208.         set a to mH
  209.         if (mH + the width of sprite 46) > 640 then
  210.           set the locH of sprite 46 to 640 - the width of sprite 46
  211.         else
  212.           set the locH of sprite 46 to a
  213.         end if
  214.       end if
  215.       if mV > 240 then
  216.         set the locV of sprite 46 to mV - the height of sprite 46
  217.       else
  218.         set the locV of sprite 46 to mV
  219.       end if
  220.       if gtxtSw1 or gtxtSw2 then
  221.         set the locH of sprite 47 to the locH of sprite 46
  222.         set the locV of sprite 47 to the locV of sprite 46
  223.       end if
  224.       updateStage()
  225.       if objectp(gLanDta) then
  226.         gLanDta(mdispose)
  227.       end if
  228.       playWave(getAt(gwaLanLst, 1), "p")
  229.     end if
  230.   end if
  231.   updateStage()
  232.   cursor(-1)
  233.   repeat with i = 8 to 44
  234.     if the castNum of sprite i > 0 then
  235.       set the cursor of sprite i to 3
  236.       next repeat
  237.     end if
  238.     set the cursor of sprite i to -1
  239.   end repeat
  240.   set gCursor to 1
  241.   set gLang2 to vLang
  242. end
  243.