home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today (BR) Volume 3 #5 / CDRV3N5.ISO / demo / introdm.dir / Internal_229.ls < prev    next >
Encoding:
Text File  |  1996-07-12  |  2.9 KB  |  129 lines

  1. on setButton
  2.   repeat with j = 4 to 9
  3.     set the cursor of sprite j to [the number of member "Push", the number of member "PushM"]
  4.   end repeat
  5. end
  6.  
  7. on unSetButton
  8.   repeat with j = 4 to 9
  9.     set the cursor of sprite j to 0
  10.   end repeat
  11. end
  12.  
  13. on PressButton buttonSprite
  14.   set puppetState to the puppet of sprite buttonSprite
  15.   set the puppet of sprite buttonSprite to 1
  16.   set isPressed to 1
  17.   set relaxedCast to the castNum of sprite buttonSprite
  18.   updateStage()
  19.   repeat while the mouseDown
  20.     set isPressed to rollOver(buttonSprite)
  21.     if the ink of sprite buttonSprite = 3 <> isPressed then
  22.       if isPressed then
  23.       else
  24.       end if
  25.       updateStage()
  26.     end if
  27.   end repeat
  28.   set the puppet of sprite buttonSprite to puppetState
  29.   return isPressed
  30. end
  31.  
  32. on IsPressButton buttonSprite
  33.   set puppetState to the puppet of sprite buttonSprite
  34.   set the puppet of sprite buttonSprite to 1
  35.   set isPressed to 1
  36.   set relaxedCast to the castNum of sprite buttonSprite
  37.   updateStage()
  38.   repeat while the mouseDown
  39.     set isPressed to rollOver(buttonSprite)
  40.     if the castNum of sprite buttonSprite = (relaxedCast + 1) <> isPressed then
  41.       if isPressed then
  42.         set the castNum of sprite buttonSprite to relaxedCast + 1
  43.       else
  44.         set the castNum of sprite buttonSprite to relaxedCast
  45.       end if
  46.       updateStage()
  47.     end if
  48.   end repeat
  49.   set the puppet of sprite buttonSprite to puppetState
  50.   return isPressed
  51. end
  52.  
  53. on runApp
  54.   global pathName, AppName
  55.   set tpath to getBack(the pathName) & pathName
  56.   if the machineType = 256 then
  57.     set tpath to tpath & "\"
  58.   else
  59.     set tpath to tpath & ":"
  60.   end if
  61.   repeat with i = 1 to the maxinteger
  62.     set n to getNthFileNameInFolder(tpath, i)
  63.     if (n = EMPTY) or (n = AppName) then
  64.       exit repeat
  65.     end if
  66.   end repeat
  67.   if the machineType = 256 then
  68.     set AppName to tpath & AppName
  69.   else
  70.     set AppName to tpath & AppName
  71.   end if
  72.   if n = EMPTY then
  73.     alert("In order to run this application, it must be installed!")
  74.     exit
  75.   else
  76.     if the machineType = 256 then
  77.       setpath(tpath)
  78.     end if
  79.     if AppName contains ".DIR" then
  80.       go(1, AppName)
  81.       dontPassEvent()
  82.       abort()
  83.     else
  84.       open(AppName)
  85.       dontPassEvent()
  86.       if the machineType <> 256 then
  87.         wait(60 * 1)
  88.       end if
  89.       quit()
  90.     end if
  91.   end if
  92. end
  93.  
  94. on getBack pathName
  95.   if the machineType = 256 then
  96.     set delim to "\"
  97.   else
  98.     set delim to ":"
  99.   end if
  100.   set max to the number of chars in pathName
  101.   repeat with i = max - 1 down to 1
  102.     set n to char i of pathName
  103.     if n = delim then
  104.       delete char i + 1 to max of pathName
  105.       exit repeat
  106.     end if
  107.   end repeat
  108.   return pathName
  109. end
  110.  
  111. on wait n
  112.   startTimer()
  113.   repeat while the timer < n
  114.   end repeat
  115. end
  116.  
  117. on settimeout
  118.   set the timeoutLength to 2 * 60 * 60
  119.   set the timeoutMouse to 1
  120.   set the timeoutKeyDown to 1
  121.   set the timeoutScript to "timeoutProcedure"
  122. end
  123.  
  124. on timeoutProcedure
  125.   unSetButton()
  126.   startMovie()
  127.   go(1)
  128. end
  129.