Monday, October 15, 2007

Birthday project - Date selection

On the weekend I completed another Game in a Day challenge for my Dozen Days of Dice series. The game that was completed was poker dice and it will be released roughly a month after Threes is released, sooner if my other planned releases are not finished. I think that I will continue doing what I am doing with threes and release the early builds of the game and the design diaries here.

Speaking of design diaries, I should get back to the game I am developing for my birthday site release. While game is not the best way of describing what I am releasing, it certainly can not be considered as something serious, though I am sure a few people out there may put too much faith in what I am going to release. I am going to have to be sure to explain my views on the matter in the instructions.

The project needs the user to enter two dates, which is such an obvious thing that one would assume there was a standard Flash component for doing this. If there is, I couldn't find it in the list of components that come with Flash CS3. Still, I am sure that there are countless libraries out there that include a component for getting a date from the user. One could even get really fancy and have the component display a calender that has pages that flip as the user changes the month or year and the selected date could be highlighted in a different color when the user clicks on it. While this wouldn't be a difficult component to create, it would be time consuming to create, and with a weekly release schedule and only limited hours (varying based on how much paid work I have at the time) this is going way overboard for what I need. Searching out for a free component that does this would probably take more time then it would to create my own simple date selector so that is what I chose to do. Yes, the fact that I am a NIH type programmer probably largely factored into my decision as well.

This is actually an incredibly easy thing to create if you use the user interface components that Flash CS3 comes with. The month is a simple combo box that has the names of the months pre-set into it. The month and year are simple number selectors with the min and max values set to logical limits. The date can be created just by grabbing the values from these three components. In fact, by grouping the three components into a movie clip it was simple to create my own date changed event that gets broad casted every time the date changes, which means that as soon as the user touches the date, the X gets updated on the fly. I'll explain what the X is on Wednesday, though I suspect anybody reading this who is up on various superstitions will know what my birthday project is tomorrow, if they haven't guessed already.

No comments: