home *** CD-ROM | disk | FTP | other *** search
/ Webster's Millennium Amer…Sign Language Dictionary / ASL.ISO / mac / SKILLS.dir / 00070_Script_70 < prev    next >
Text File  |  2001-09-05  |  2KB  |  57 lines

  1. on setBtn2 pos
  2.   global TEMPLATE1, KNOB1, minPos1, maxPos1,gNumQs
  3.   global maxScroll,minScroll,gCat,scrollList
  4.   put maxscroll*1.0-minScroll*1.0 into scrollRange
  5.   put float(scrollRange/(maxPos1-minPos1)) into scrollRatio
  6.   put max(integer((maxPos1-minPos1)/scrollRange),1) into sliderRatio
  7.   set the locH of sprite KNOB1 = minPos1 --+ integer(sliderRatio*(pos-1))
  8.   
  9.   set refVal = getQVal(the locH of sprite KNOB1,scrollRange,scrollRatio,minPos1)
  10.   
  11.   set the text of cast "whichq" = string(integer(refVal))&&"of"&&gNumQs
  12.   
  13.   updatestage
  14.   
  15.   set refVal = getQVal(the locH of sprite KNOB1,scrollRange,scrollRatio,minPos1)
  16.   
  17.   aQuestion 1
  18.   
  19. end setBtn2
  20.  
  21. on buttonDown1 
  22.   global TEMPLATE1, KNOB1, minPos1, maxPos1,gNumQs
  23.   global maxScroll,minScroll,gCat,scrollList
  24.   put maxscroll*1.0-minScroll*1.0 into scrollRange
  25.   put scrollRange/(maxPos1-minPos1) into scrollRatio
  26.   set oldMouseH = the mouseH
  27.   repeat while the stillDown 
  28.     if oldMouseH <> the mouseH then
  29.       set the locH of sprite KNOB1 = max( minPos1, min( ( the mouseH ) , maxPos1 ) )
  30.       set refVal = getQVal(the locH of sprite KNOB1,scrollRange,scrollRatio,minPos1)
  31.       set the text of cast "whichq" = string(integer(refVal))&&"of"&&gNumQs
  32.       updateStage
  33.       set oldMouseH = the mouseH  
  34.     end if
  35.   end repeat
  36.   aQuestion refVal
  37. end buttonDown1
  38.  
  39. on getQVal locRef,scrollRange,scrollRatio,TheLeft
  40.   global maxScroll,minScroll
  41.   return minScroll+((locRef)-TheLeft)*scrollRatio 
  42. end getQVal
  43.  
  44. on setWord locRef,scrollRange,scrollRatio,TheLeft
  45.   global scrollList
  46.   global maxScroll,minScroll
  47.   put ((locRef)-TheLeft)*scrollRatio into scrollLoc
  48.   put minScroll+scrollLoc into refVal
  49.   --ïïïput "minScroll-"&minScroll&&"scrollLoc-"&scrollLoc&&"refVal-"&refVal
  50.   set the text of cast "word name" to line refVal of scrollList --cstName
  51.   set the text of cast "word" to line refVal of scrollList --cstName
  52.   --ïïïput line refVal of scrollList
  53.   set tempStr = string(integer(scrollLoc)+1)&"/"&string(integer(scrollrange)+1) 
  54.   set the text of cast "word #" to tempStr
  55.   return line refVal of scrollList
  56. end
  57.