The other day I needed some sort of component to control the time left in a game and display it graphically. After checking out the Degrafa site I found a great example of using Degrafa with the timer class in Flex - http://dean-logan.com/demo/Flex/EggTimer/
Then I remembered a nice class created by Uday Shankar called AutoRefresher - This class essentially controls the timer and related functions and helps handle the timer events.
By combining the two, the end result was an extensible component that could be quickly dropped into an app, or could be customized to do different things. I think with more work, the graphic part of the component could easily make it different shapes or add different animation effects.
I did have to make a couple changes to the AutoRefresher class, so if you might not want to overwrite it with the original. Overall, the component seems to work well, but there are sometimes graphic glitches when reversing the progress bar direction and I could never figure out a way to make the progress bar go from bottom to top (vertically).
I also didn't bother to figure out the math to make it work with any time and delay combination (maybe round or something?) so if you can't evenly divide the total time (in seconds) by the delay (in seconds) it won't work.
Anyway, source view is enabled so modify it however you want and if you fix something major let me know and I will update it.
Demo is here and source is here
RSS Feed
Apr 29 2009 by Abnermil
Make Yoself Heard