• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Workshop Chapter 10. Creating Timers > Creating a Countdown Timer

Creating a Countdown Timer

Whereas the analog timer built upon code created in the digital timer section, the countdown timer is more like the horizontal slider we made back in Workshop Chapter 3, “Creating a Horizontal Slider.” Because it uses getTimer(),however, I figured it fits well in this chapter.

The countdown timer will act like a kitchen timer: simply start it timing and it will go off after the elapsed time has expired. In this exercise, a filled rectangle will empty a little bit at a time until it’s totally empty, and then a sound will play and another function will get invoked. After getting the main functionality working, you can add refined graphics to make any effect you want—for example, an hourglass effect (see Figure W10.9).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint