button bounce script

2000-03-05 Thread Brian Thomas

Hi,

I'm not a professional scripter, I'm more of a content-producer and
designer, but I do a lot of simple scripting. Below is the first script I
wrote in MetaCard. I was very proud of it -- until it begin to make my
buttons seep slowly down the page. The idea is to make a button react when
you click on it. My project is so huge, there are so many different kind of
clickable things that this was a good universal reaction that they all
could share.

The script works perfectly almost all the time. At first I would just
notice that buttons would be re-positioned down and to the right. But would
not be able to reproduce the problem while I was clicking on them and
looking at them. Now I have noted that on a button on a palette that sends
a message to a handler on its main stack script, all I have to do is
machine gun click the buttons as rapidly as I can and they will immediately
begin to slide down the page. Anyone have any ideas how I can bullet-proof
this simple script? Or replace it with a better one? I would prefer not to
have to buttons, in different positions, and set the visible to true and
false, as this would entail a great deal of work.

Button script

on mouseDown
  downThumbnail
  upThumbnail
end mouseDown

on mouseUp
  set cursor to watch
  go next cd
end mouseUp


Stack script

on downThumbnail
  move the target relative  2, 2 in 90 millisecs
  move the target relative  -2, -2 in 90 millisecs
end downThumbnail

on upThumbnail   # left this empty handler in all buttons in case it would
be useful in fix

end upThumbnail

This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm



button bounce script

2000-03-05 Thread Nelson Zink

Brian ,

The idea is to make a button react when you click on it.

Is this the kind of thing you're looking for?

on thumb
  put 30 into RR  --number of repeats
  put 5 into WW --speed setting
  repeat RR  --contract
put the rect of the target into temp
add 1 to item 1 of temp
add 1 to item 2 of temp
add -1 to item 3 of temp
add -1 to item 4 of temp
set the rect of the target to temp
wait WW milliseconds
  end repeat
  
  repeat RR  --expand
put the rect of the target into temp
add -1 to item 1 of temp
add -1 to item 2 of temp
add 1 to item 3 of temp
add 1 to item 4 of temp
set the rect of the target to temp
wait WW milliseconds
  end repeat
end thumb

on thumb2
  put 3 into FR  --flicker rate
  put  the backgroundcolor of the target into temp
  repeat 5
set the backgroundcolor of the target  to green
wait FR ticks
set the backgroundcolor of the target  to red
wait FR ticks
  end repeat
  set the backgroundcolor of the target to temp
end thumb2

Or do you just want to make extra double sure that the button doesn't 
creep on you?  
If so, try:

on downThumbnail
  put the rect of the target into temp
  move the target relative  2, 2 in 90 millisecs
  move the target relative  -2, -2 in 90 millisecs
  set the rect of the target to temp
end downThumbnail


NZN

This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm