AS3 Component: TimeStepper

Posted on October 8, 02008
Filed Under DaVinci, Development, Flash

Download the code

Following on from the generic NumberStepper I think I'm ready to build my first specific temporal component. I've decided a simple TimeStepper that combines Hours, Minutes and Seconds would be a good one to start with.

The functionality
As far as functionality is concerned it comes down to one decision: Are the three fields related? It's assumed that if you step up or down through a field it will rollover so as to always contain a valid value. The question, by way of example, is this. if you step the minute value past 60 does it increment the hour value by one?

My take on it is this. The component combines three fields so their values are related. Rolling over one field increments or decrements it's partner. if you don't want the fields to rollover then use separate NumberSteppers.

TimeStepper demo

The structure
The TimeStepper is obviously composed of three NumberSteppers. What's interesting though is that all the step actions update a single Date value. The component then makes use of the invalidation() functionality in BaseComponent to schedule a draw().

Share/Bookmark

Related Journal Entries

  1. Building an AS3 component framework: Suspend and Resume
  2. AS3 component: NextPreviousButton
  3. Component framework July update
  4. The project architecture
  5. Building an AS3 component framework: Events and Inheritance
  6. Building an AS3 component framework: Deferred Rendering
  7. Building an AS3 component framework: Garbage Management
  8. Inside the Bit-101 MinimalComps
  9. Building an AS3 component framework: Planning
  10. Choosing an AS3 component framework
  11. AS3 Component: NumberStepper
  12. The Computus Engine on Google Code
  13. Building an AS3 component framework: The Finished BaseComponent Class
  14. Creating a main preloader in Flash CS3
  15. Projects update March 2009

Comments

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments