home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1995 May / TYPEMANIA.ISO / rom.dir / 00001_Script_1 next >
Text File  |  1994-02-26  |  6KB  |  197 lines

  1. --here comes a procedure for buttonreactions
  2. --this ist the Version 0.9 from 16.9.94
  3. --⌐Retina,1994
  4. on ButtonHdl theChannel, Type, ScriptToExecute,BaloonSprite,TextSprite,BaloonText
  5.   global gMovement
  6.   set flag=0
  7.   
  8.   
  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.   --set the text of cast 5 to "Type erkannt als: "&string(type)
  13.   -- "type" 0: bedeutet normales Ersetzen
  14.   -- "type" 1: bedeutet Verschiebung um gMovement
  15.   -- "type" 2: bedeutet 1 + Baloon
  16.   -- "type" 3: bedeutet 2 + Baloon
  17.   if Type=0 then
  18.     -- normales Ersetzen
  19.     
  20.     set the castnum of sprite theChannel to myCast+1
  21.     updatestage
  22.     repeat while the mousedown
  23.       if not rollover(theChannel) then exit repeat
  24.     end repeat
  25.     if rollover(theChannel) then set flag = 1
  26.     set the castNum of sprite theChannel to myCast
  27.     updatestage
  28.   else if Type=1 then
  29.     -- Verschiebung
  30.     set the locH of sprite theChannel to myLocH+gMovement
  31.     set the locV of sprite theChannel to myLocV+gMovement
  32.     updatestage
  33.     repeat while the mousedown
  34.       if not rollover(theChannel) then exit repeat
  35.     end repeat
  36.     if rollover(theChannel) then set flag = 1
  37.     set the locH of sprite theChannel to myLocH
  38.     set the locV of sprite theChannel to myLocV
  39.     updatestage 
  40.   else if Type=2 then
  41.     -- Ersetzen+Baloon
  42.     if not (baloonText=empty) then
  43.       if not(stringp (baloontext)) then 
  44.         alert "kein Text vorhanden"
  45.         exit
  46.       end if
  47.     end if
  48.     set the castnum of sprite theChannel to myCast+1
  49.     set the locH of sprite BaloonSprite to the mouseH
  50.     set the locV of sprite BaloonSprite to the mouseV
  51.     set the visibility of sprite BaloonSprite to true
  52.     
  53.     set the locH of sprite Textsprite to the mouseH+5
  54.     set the locV of sprite Textsprite to the mouseV+5
  55.     set the text of cast(the castnum of sprite TextSprite) to Baloontext
  56.     
  57.     --nun ⁿberprⁿfe, ob der Text auch pa▀t
  58.     set ht=the height of cast(the castnum of sprite Textsprite)
  59.     set bt=the height of cast(the castnum of sprite Baloonsprite)
  60.     if ht>bt then   
  61.       set temp to integer((the number of chars in Baloontext)*(float(bt-19)/float(ht))-25)
  62.       set the text of cast(the castnum of sprite TextSprite) to chars(Baloontext,1,temp)
  63.     end if   
  64.     set the visibility of sprite Textsprite to true
  65.     updatestage
  66.     repeat while the mousedown
  67.       if not rollover(theChannel) then exit repeat
  68.     end repeat
  69.     if rollover(theChannel) then set flag = 1
  70.     set the castNum of sprite theChannel to myCast
  71.     set the visibility of sprite Baloonsprite to false
  72.     set the visibility of sprite Textsprite to false
  73.     updatestage
  74.     
  75.   else if Type=3 then
  76.     -- Verschieben+Baloon
  77.     set the locH of sprite theChannel to myLocH+gMovement
  78.     set the locV of sprite theChannel to myLocV+gMovement
  79.     updatestage
  80.     repeat while the mousedown
  81.       if not rollover(theChannel) then exit repeat
  82.     end repeat
  83.     if rollover(theChannel) then set flag = 1
  84.     set the locH of sprite theChannel to myLocH
  85.     set the locV of sprite theChannel to myLocV
  86.     updatestage 
  87.   else if Type =4 then
  88.     puppetsound "Mouse Down"
  89.     --ersetzen und verschieben
  90.     set the castnum of sprite theChannel to myCast+1
  91.     set the locH of sprite theChannel to myLocH+gMovement
  92.     set the locV of sprite theChannel to myLocV+gMovement
  93.     updatestage
  94.     repeat while the mousedown
  95.       if not rollover(theChannel) then exit repeat
  96.     end repeat
  97.     puppetsound 0
  98.     if rollover(theChannel) then set flag = 1
  99.     set the locH of sprite theChannel to myLocH
  100.     set the locV of sprite theChannel to myLocV
  101.     set the castNum of sprite theChannel to myCast
  102.     updatestage 
  103.     --not yet defined
  104.     
  105.     
  106.     
  107.   else 
  108.     exit
  109.   end if
  110.   
  111.   if flag then 
  112.     do scriptToExecute
  113.     --updateStage 
  114.   end if 
  115. end ButtonHdl
  116.  
  117. on StartMovie
  118.   global gSnd, gMovement
  119.   set gMovement=2
  120.   if the quickTimePresent=false then
  121.     alert "Fⁿr diese Anwendung ben÷tigen Sie Quicktime"
  122.   end if
  123.   set the mousedownscript to "BackToTheRoot"
  124. end StartMovie
  125.  
  126. on BackToTheRoot
  127. if the optiondown then go to frame 75
  128.  
  129. end BackToTheRoot
  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 playMoov
  139. global play
  140. set play=1
  141. set the Movierate of sprite 12 to 1
  142. end playMoov
  143.  
  144. on stopMoov
  145. global play
  146. set play=0
  147. set the movierate of sprite 12 to 0
  148. end stopMoov
  149.  
  150.  
  151.  
  152. on FlashRoller whichChannel, scriptToExecute
  153. set myCast = the castNum of sprite whichChannel
  154. set flag = 0
  155. set the castNum of sprite whichChannel = myCast+1
  156. updateStage 
  157. repeat while the mouseDown
  158. if not rollover(whichChannel) then exit repeat
  159. end repeat      
  160. if rollover(whichChannel) then set flag = 1
  161. set the castNum of sprite whichChannel = myCast
  162. updateStage
  163. if flag then 
  164. do scriptToExecute
  165. updateStage
  166. end if
  167. end FlashRoller
  168.  
  169. on soundcontrol
  170. global snd
  171. repeat while the mousedown
  172. set mousepos=the mouseV
  173. set the locH of sprite 24 to constrainH(13, the mouseH)
  174. set the locV of sprite 24 to constrainV(13, mousepos)
  175. set the visibility of sprite 14+snd to false
  176. --nun kommt die genaue Abfrage
  177. set Regler=constrainV(13, mousepos)    
  178. set snd=integer((regler-280)/10)
  179. set the visibility of sprite 14+snd to true
  180. updatestage  
  181. end repeat
  182. end soundcontrol
  183.  
  184. on hyperclick Text, Highlight
  185.  
  186. --set DasWort=
  187. set the text of cast 5 to word (the mouseword) of the text of cast (the castnum of sprite Text)
  188. hilite word (the mouseword) of field (the castnum of sprite Text)
  189. repeat while the mousedown
  190. if not rollover(Text) then exit repeat
  191. end repeat
  192. --set the hilite of sprite Text to false
  193. --set the selend to 0
  194. hilite char 32000 of field (the castnum of sprite Text)
  195. updatestage
  196. end hyperclick
  197.