Calendar

I want to design a calendar, such that it contains 5 rows and 6 columns, and the number is present on the each button, and if i click on the button, it should display the number in text.
Example if i click on 20th button, it should display “Twenty”.

How to do this in ActionScript3.0 using FlexBuilder3.0.
Any one have idea, pls post to me.

Just reaaaaaally basic, what my head would say when he would think about making a calendar:

create an array with all names:
var _Days:Array = new Array(“one”,“two”,“three”,“four”,“five”,“six”,“seven”,"…and so on");

then you could make a class which represents your button, in there you have (at least) a textfield, a property id and a property daytext.

to create a monthly sheet you could use a for loop:


for(var i = 1; i<=DaysThisMonth; i++){
/*
here you need to create your button via the class
set the x and y values
you set id = i and DayText = _Days*
set the textfield.text value to id
then you need to add an eventhandler which reacts on clicking the button
(there are some nice tutorials here on kirupa or in the internet)
*/
}

maybe that sends you in the right the direction.

If you have any more detailled question, feel free to ask.

hth

I will create one text field, and one event listener for the button. if i click on 1, how to get “one” i did not get u? can u tell me some more clearly.

I can try

you could make a function in your DayClass (the one with the textfield)


public function changeText():void{
    if(this.YourTextField.text == this.DayText){
        this.YourTextField.text = this.id;
    }else{
        this.YourTextField.text = this.DayText;
    }
}

this would change the textfield from “1” to “one” or the other way around.

Is that the effect you want to achieve? If not, where do you want to show the text “one”?