This content has been marked as final. Show 3 replies
..and here's another way to do it...
View source at:
Main difference is I'm using arithmetic on the current date to get you a date one month out, and using the formatted result as a bindable in the slider labels property. Since the "futureDate" var contains today's date + one month, you could also use this var anywhere else in your code where you need the entire future date. This is useful at the end of the current year, where you might want to add two months to today's date, and get a date in 2009, for instance.
I included the use of the Date formatter class to get you started on returning just a portion of a date, formatted as you wish (M="1", MM="01", MMM= "Jan", MMMM= "January"). Simply change the formatter's format string and the slider's labels will also be updated.
On more thing...if you are planning on using the slider's retun value to get a month's number, remember that in actionscript the month numbering starts at 0 (you are specifying 1-12; AS uses 0-11).
Thanks alot. I have it working to select the current month. I cannot seem to get it to start out that way. when the app loads it brings in the data, All months are shown in my chart, and the correct month (Dec) is where the thumbs is (so thats good) when I move the thumb to November it changes the chart perfect. But when it loads there are all 12 months how can I get it to just have December to start? When I move the thumb back to December it looks perfect. Thanks for all your help.