home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1995 May / TYPEMANIA.ISO / systhema.dir / 00001_Script_1 next >
Text File  |  1995-02-27  |  7KB  |  220 lines

  1. --here comes a procedure for buttonreactions
  2. --this ist the Version 0.95 from 17.11.94
  3. --⌐Retina,1994
  4. on ButtonHdl Type, ScriptToExecute,BaloonSprite,TextSprite,BaloonText
  5.   global gMovement
  6.   set flag=0
  7.   
  8.   set theChannel=the ClickOn
  9.   set myCast=the castNum of sprite theChannel
  10.   set myLocH=the locH of sprite theChannel
  11.   set myLocV=the locV of sprite theChannel
  12.   forgetwin
  13.   
  14.   -- "type" 0: bedeutet normales Ersetzen
  15.   -- "type" 1: bedeutet Verschiebung um gMovement
  16.   -- "type" 2: bedeutet 1 + Baloon
  17.   -- "type" 3: bedeutet 2 + Baloon
  18.   
  19.   if Type=0 then
  20.     -- normales Ersetzen
  21.     puppetsound "Mouse Down"
  22.     set the castnum of sprite theChannel to myCast+1
  23.     updatestage
  24.     repeat while the mousedown
  25.       if not rollover(theChannel) then exit repeat
  26.     end repeat
  27.     if rollover(theChannel) then set flag = 1
  28.     set the castNum of sprite theChannel to myCast
  29.     updatestage
  30.     
  31.   else if Type=1 then
  32.     -- Verschiebung
  33.     set the locH of sprite theChannel to myLocH+gMovement
  34.     set the locV of sprite theChannel to myLocV+gMovement
  35.     updatestage
  36.     repeat while the mousedown
  37.       if not rollover(theChannel) then exit repeat
  38.     end repeat
  39.     if rollover(theChannel) then set flag = 1
  40.     set the locH of sprite theChannel to myLocH
  41.     set the locV of sprite theChannel to myLocV
  42.     updatestage 
  43.     
  44.   else if Type=2 then
  45.     -- Ersetzen+Baloon
  46.     if not (baloonText=empty) then
  47.       if not(stringp (baloontext)) then 
  48.         alert "kein Text vorhanden"
  49.         exit
  50.       end if
  51.     end if
  52.     set the castnum of sprite theChannel to myCast+1
  53.     set the locH of sprite BaloonSprite to the mouseH
  54.     set the locV of sprite BaloonSprite to the mouseV
  55.     set the visibility of sprite BaloonSprite to true
  56.     
  57.     set the locH of sprite Textsprite to the mouseH+5
  58.     set the locV of sprite Textsprite to the mouseV+5
  59.     set the text of cast(the castnum of sprite TextSprite) to Baloontext
  60.     
  61.     --nun ⁿberprⁿfe, ob der Text auch pa▀t
  62.     set ht=the height of cast(the castnum of sprite Textsprite)
  63.     set bt=the height of cast(the castnum of sprite Baloonsprite)
  64.     if ht>bt then   
  65.       set temp to integer((the number of chars in Baloontext)*(float(bt-19)/float(ht))-25)
  66.       set the text of cast(the castnum of sprite TextSprite) to chars(Baloontext,1,temp)
  67.     end if   
  68.     set the visibility of sprite Textsprite to true
  69.     updatestage
  70.     repeat while the mousedown
  71.       if not rollover(theChannel) then exit repeat
  72.     end repeat
  73.     if rollover(theChannel) then set flag = 1
  74.     set the castNum of sprite theChannel to myCast
  75.     set the visibility of sprite Baloonsprite to false
  76.     set the visibility of sprite Textsprite to false
  77.     updatestage
  78.     
  79.   else if Type=3 then
  80.     -- Verschieben+Baloon
  81.     set the locH of sprite theChannel to myLocH+gMovement
  82.     set the locV of sprite theChannel to myLocV+gMovement
  83.     updatestage
  84.     repeat while the mousedown
  85.       if not rollover(theChannel) then exit repeat
  86.     end repeat
  87.     if rollover(theChannel) then set flag = 1
  88.     set the locH of sprite theChannel to myLocH
  89.     set the locV of sprite theChannel to myLocV
  90.     updatestage 
  91.     
  92.   else if Type =4 then
  93.     set the castnum of sprite theChannel to myCast+1
  94.     set the locH of sprite theChannel to myLocH+gMovement
  95.     set the locV of sprite theChannel to myLocV+gMovement
  96.     updatestage
  97.     repeat while the mousedown
  98.       if not rollover(theChannel) then exit repeat
  99.     end repeat
  100.     if rollover(theChannel) then set flag = 1
  101.     set the locH of sprite theChannel to myLocH
  102.     set the locV of sprite theChannel to myLocV
  103.     set the castNum of sprite theChannel to myCast
  104.     updatestage 
  105.     --not yet defined
  106.     
  107.   else 
  108.     exit
  109.   end if
  110.   
  111.   if flag and stringp(scriptToExecute) then 
  112.     do scriptToExecute
  113.     updateStage 
  114.   end if 
  115. end ButtonHdl
  116.  
  117. on StartMovie
  118.   global gSnd, gMovement
  119.   set gMovement=20
  120.   if the quickTimePresent=false then
  121.     alert "Fⁿr diese Anwendung ben÷tigen Sie Quicktime"
  122.   end if
  123.   --▄berprⁿfe ob QT 1.6.1 installiert ist
  124.   --▄berprⁿfe, ob Sound Manager 3 installiert ist
  125.   --jetzt kommen die Cursor
  126.   --openResFile "simpleCurs"
  127.   --Initcursor 128, 3, 14
  128.   --set snd=0
  129. end StartMovie
  130.  
  131. on InitCursor ID, RangeStart, RangeEnd
  132.   cursor 133
  133.   repeat with n=RangeStart to RangeEnd
  134.     set the cursor of sprite n to ID
  135.   end repeat
  136. end InitCursor
  137.  
  138. on playMe myfile,message
  139.   alert message
  140.   play movie myfile
  141. end playMe
  142.  
  143. on playMoov
  144.   global play
  145.   set play=1
  146.   set the Movierate of sprite 16 to 1
  147. end playMoov
  148.  
  149. on stopMoov
  150.   global play
  151.   set play=0
  152.   set the movierate of sprite 16 to 0
  153. end stopMoov
  154.  
  155. on forgetwin
  156.   if (the windowlist=[])=0 then
  157.     forget window 1
  158.   end if
  159. end forgetWin
  160.  
  161.  
  162. on QT_Win
  163.   if (the windowlist=[]) = 0 then
  164.     forget window 1
  165.   end if
  166.   
  167.   open window "Sys_win.dir"
  168.   set the windowType of window "Sys_win.dir" to 49
  169.   updatestage
  170. end
  171.  
  172.  
  173.  
  174. on FlashRoller whichChannel, scriptToExecute
  175.   set myCast = the castNum of sprite whichChannel
  176.   set flag = 0
  177.   set the castNum of sprite whichChannel = myCast+1
  178.   updateStage 
  179.   repeat while the mouseDown
  180.     if not rollover(whichChannel) then exit repeat
  181.   end repeat      
  182.   if rollover(whichChannel) then set flag = 1
  183.   set the castNum of sprite whichChannel = myCast
  184.   updateStage
  185.   if flag then 
  186.     do scriptToExecute
  187.     updateStage
  188.   end if
  189. end FlashRoller
  190.  
  191. on soundcontrol
  192.   global snd
  193.   repeat while the mousedown
  194.     set mousepos=the mouseV
  195.     set the locH of sprite 24 to constrainH(13, the mouseH)
  196.     set the locV of sprite 24 to constrainV(13, mousepos)
  197.     set the visibility of sprite 14+snd to false
  198.     --nun kommt die genaue Abfrage
  199.     set Regler=constrainV(13, mousepos)    
  200.     set snd=integer((regler-280)/10)
  201.     set the visibility of sprite 14+snd to true
  202.     updatestage  
  203.   end repeat
  204. end soundcontrol
  205.  
  206. on hyperclick Text, Highlight
  207.   
  208.   --set DasWort=
  209.   set the text of cast 5 to word (the mouseword) of the text of cast (the castnum of sprite Text)
  210.   hilite word (the mouseword) of field (the castnum of sprite Text)
  211.   repeat while the mousedown
  212.     if not rollover(Text) then exit repeat
  213.   end repeat
  214.   --set the hilite of sprite Text to false
  215.   --set the selstart to 0
  216.   --set the selend to 0
  217.   hilite char 32000 of field (the castnum of sprite Text)
  218.   updatestage
  219. end hyperclick
  220.