Plangarden Garden Design & Planning Software

« New weather stations added to Plangarden vegetable software | Home | Plangarden Review by Dave’s Garden Website »

Actionscript 3 DateChooser created

By roystahl | February 11, 2008

After messing around with a few datechooser components and incomplete source code, I finally decided to write my own date chooser. Since this is something that I wanted to use, and not just recreate the old ActionScript 2 component, I put some real work and thought into it.

Here is what I came up with. The is a display date field and a calendar pop-up box. Unlike the old component, my new Actionscript 3 version allows you to enter the day in the input field OR by clicking on dates on the pop-up calendar. It also has error catching code that displays the date in RED if you enter the date wrong. You can also set a preference if the month is first or the day is first.

The pop-up calendar has mouse-overs for the dates as you move around. There is the standard forward and back month arrow buttons (since I am using this for a vegetable garden software, I don’t need to go forward and back by years, but this would be easy to add). The current date and the selected date are both highlighted and shown on the calendar.

Cool bonus feature is when you open the pop-up calendar, you can change the date in the text field and the display calendar will update.

I haven’t measured the size of this, but because I didn’t add all sorts of fancy bells and whistles, it should be VERY compact and small. In my application, I don’t even see how much is added, but is isn’t very much.

Of course, I made it for me, so it isn’t skinable or have developer controllable features, but still it is nice. It does allow the pop-up calendar to be sized to whatever size you want without messing up. It recalculates the size needed for date boxes, and doesn’t zoom in and out, so the fonts for the calendar is always readable. Currently to smallest size I allow is 170×170, but if the fonts where made smaller, you could probably get a nice small calendar to pop up and allow input at under 150 or so. Still it has many nice features and is also optimized for speed. I tried to do things smartly so it would render fast. There are a few things to make it run faster, but I doubt that there are any computers that would have a problem with this.

If you are interested in the ActionScript 3 DateChooser I have created, just drop a comment in this blog, or send me an email. It is my first name and this domain.

Topics: ActionScript 3, DateChooser |

3 Responses to “Actionscript 3 DateChooser created”

  1. kevin Says:
    July 3rd, 2008 at 4:57 pm

    Dear Roystahl,
    I read your article on http://plangarden./2008/02/11/actionscript-3-datechooser-created/ about AS3 Datechooser, I am an ActionScript3 beginer and looking for AS3 DateChooser. I need datechooser component in my project. Can you help me?

  2. AS2 looks silly compared to AS3 | Plangarden Garden Design & Planning Software Says:
    August 26th, 2008 at 9:11 pm

    […] of this is because Adobe left out components that I needed so I had to write my own windowing and DateChooser (which I now offer for free to anyone that emails me) These are definately smaller than the old […]

  3. Teklan Says:
    January 12th, 2009 at 8:58 am

    Hello Roystahl

    would you please be so kind and send me the source code of your Calendar. I am a Flash Beginner and already have to get some stuff worked till the end of January. Currently, I am in some panic state^^

Comments

You must be logged in to post a comment.