home *** CD-ROM | disk | FTP | other *** search
/ Dictionnaire Multimedia Multilingue (Home PC 42) / dictionarvizual.iso / data / englalph.dir / 00040.ls < prev    next >
Encoding:
Text File  |  1996-03-13  |  5.8 KB  |  190 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
  42.   if gCursor = 0 then
  43.     exit
  44.   end if
  45.   set mV to the mouseV
  46.   set mH to the mouseH
  47.   set moused to the mouseCast + 6
  48.   if (the mouseCast < 2) or (the mouseCast > 38) then
  49.     exit
  50.   end if
  51.   set the ink of sprite moused to 2
  52.   set the visible of sprite moused to 1
  53.   updateStage()
  54.   waitTicks(15)
  55.   set the visible of sprite moused to 0
  56.   if gAct = "f" then
  57.   else
  58.     set gCursor to 0
  59.     cursor(4)
  60.     repeat with i = 8 to 44
  61.       set the cursor of sprite i to 4
  62.     end repeat
  63.     updateStage()
  64.     set thePointer to getAt(glObj, moused - 7)
  65.     if thePointer > -1 then
  66.       if objectp(gLanDta) then
  67.         gLanDta(mdispose)
  68.       end if
  69.       set gLanDta to FileIO(mnew, "read", HDdir & "wa_lan.dta")
  70.       set g to gLanDta(mSetPosition, getAt(gwaLanDp, thePointer))
  71.       set gwaLanLst to []
  72.       repeat with i = 1 to 5
  73.         set theText to gLanDta(mReadToken, "|", "|")
  74.         append(gwaLanLst, theText)
  75.       end repeat
  76.       set the regPoint of cast txBackSin to point(0, 0)
  77.       set the regPoint of cast txBackDbl to point(0, 0)
  78.       set words1 to getAt(gwaLanLst, gLang1 + 2)
  79.       set words2 to getAt(gwaLanLst, gLang2 + 2)
  80.       if gtxtSw1 and gtxtSw2 then
  81.         if length(words1) > length(words2) then
  82.           set bigger to length(words1)
  83.         else
  84.           set bigger to length(words2)
  85.         end if
  86.         set the castNum of sprite 45 to txBackDbl
  87.         if bigger < 13 then
  88.           set the text of cast txFrSmall to words1 & RETURN & words2
  89.           set the castNum of sprite 46 to txFrSmall
  90.           set the rect of sprite 45 to the rect of cast txFrSmall
  91.         else
  92.           if bigger < 25 then
  93.             set the text of cast txFrMed to words1 & RETURN & words2
  94.             set the castNum of sprite 46 to txFrMed
  95.             set the rect of sprite 45 to the rect of cast txFrMed
  96.           else
  97.             set the text of cast txFrBig to words1 & RETURN & words2
  98.             set the castNum of sprite 46 to txFrBig
  99.             set the rect of sprite 45 to the rect of cast txFrBig
  100.           end if
  101.         end if
  102.       else
  103.         if gtxtSw1 then
  104.           set bigger to length(words1)
  105.           set the castNum of sprite 45 to txBackSin
  106.           if bigger < 13 then
  107.             set the text of cast txFrSmall to words1
  108.             set the castNum of sprite 46 to txFrSmall
  109.             set the rect of sprite 45 to the rect of cast txFrSmall
  110.           else
  111.             if bigger < 25 then
  112.               set the text of cast txFrMed to words1
  113.               set the castNum of sprite 46 to txFrMed
  114.               set the rect of sprite 45 to the rect of cast txFrMed
  115.             else
  116.               set the text of cast txFrBig to words1
  117.               set the castNum of sprite 46 to txFrBig
  118.               set the rect of sprite 45 to the rect of cast txFrBig
  119.             end if
  120.           end if
  121.         else
  122.           if gtxtSw2 then
  123.             set bigger to length(words2)
  124.             set the castNum of sprite 45 to txBackSin
  125.             if bigger < 13 then
  126.               set the text of cast txFrSmall to words2
  127.               set the castNum of sprite 46 to txFrSmall
  128.               set the rect of sprite 45 to the rect of cast txFrSmall
  129.             else
  130.               if bigger < 25 then
  131.                 set the text of cast txFrMed to words2
  132.                 set the castNum of sprite 46 to txFrMed
  133.                 set the rect of sprite 45 to the rect of cast txFrMed
  134.               else
  135.                 set the text of cast txFrBig to words2
  136.                 set the castNum of sprite 46 to txFrBig
  137.                 set the rect of sprite 45 to the rect of cast txFrBig
  138.               end if
  139.             end if
  140.           end if
  141.         end if
  142.       end if
  143.       if mH > 320 then
  144.         set a to mH - the width of sprite 45
  145.         if a < 0 then
  146.           set the locH of sprite 45 to 0
  147.         else
  148.           set the locH of sprite 45 to a
  149.         end if
  150.       else
  151.         set a to mH
  152.         if (mH + the width of sprite 45) > 640 then
  153.           set the locH of sprite 45 to 640 - the width of sprite 45
  154.         else
  155.           set the locH of sprite 45 to a
  156.         end if
  157.       end if
  158.       if mV > 240 then
  159.         set the locV of sprite 45 to mV - the height of sprite 45
  160.       else
  161.         set the locV of sprite 45 to mV
  162.       end if
  163.       if gtxtSw1 or gtxtSw2 then
  164.         set the locH of sprite 46 to the locH of sprite 45
  165.         set the locV of sprite 46 to the locV of sprite 45
  166.       end if
  167.       updateStage()
  168.       if objectp(gLanDta) then
  169.         gLanDta(mdispose)
  170.       end if
  171.     end if
  172.   end if
  173.   set vLang to gLang2
  174.   set gLang2 to 0
  175.   playWave(getAt(gwaLanLst, 1), "p")
  176.   set gLang2 to vLang
  177.   set the locH of sprite 45 to 800
  178.   set the locH of sprite 46 to 800
  179.   updateStage()
  180.   cursor(-1)
  181.   repeat with i = 8 to 44
  182.     if the castNum of sprite i > 0 then
  183.       set the cursor of sprite i to 3
  184.       next repeat
  185.     end if
  186.     set the cursor of sprite i to -1
  187.   end repeat
  188.   set gCursor to 1
  189. end
  190.