Economy-x-Talk - Sample Scripts
Color button animation
1. create a series of icons to "animate" using Hypercard's icon editor.
2. invert the icons. In other words, the white pixels are the ones
which will be colored.
3. color the button the color that you want to give to the icons, using
addColor. The color will show through the white pixels in the icon.
4. place the icon in a black area of the card, for example a black
header, title, footer, etc.
5. place a script in your card script:
6. When the icon changes, it will do so in color, as the color will always fill the white space in the button. I've used this to animate a beating heart for example.
Brian Yennie
The scripts and comments come from HyperActive Software HyperCard Tips and Tricks websiteAll contents copyright (C) 1996, HyperActive Software. All rights reserved.
http://www.hyperactivesw.com/
on idleHandler
global currentIcon, firstIcon, lastIcon, lastTime
if firstIcon is empty then put 400 into firstIcon -- this is arbitrary
if lastIcon is empty then put 410 into lastIcon -- ditto
if currentIcon is empty then put firstIcon into currentIcon
if lastTime is empty then put the ticks into lastTime
if lastTime - 60 >= the ticks then -- wait 1 second between frames
put the ticks into lastTime
if currentIcon = lastIcon then
put firstIcon into currentIcon
else
add 1 to currentIcon
end if
set the icon of cd btn "icon button" to currentIcon -- arbitrary button
end if
end idleHandler
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.