# Calendar

**URL:** <https://forum.kirupa.com/t/calendar/260277>\
**Category:** Uncategorized\
**Created:** [May 14, 2008, 3:52am UTC](https://forum.kirupa.com/t/calendar/260277 "2008-05-14T03:52:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolheart](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@coolheart](https://forum.kirupa.com/u/coolheart)\
**Post date:** [May 14, 2008, 3:52am UTC](https://forum.kirupa.com/t/calendar/260277/1 "2008-05-14T03:52:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hasch2o](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@hasch2o](https://forum.kirupa.com/u/hasch2o)\
**Post date:** [May 14, 2008, 4:42am UTC](https://forum.kirupa.com/t/calendar/260277/2 "2008-05-14T04:42:24Z")

</div>

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:

```auto

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

---

<div class="post-metadata">

**Author:** ![coolheart](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@coolheart](https://forum.kirupa.com/u/coolheart)\
**Post date:** [May 14, 2008, 5:00am UTC](https://forum.kirupa.com/t/calendar/260277/3 "2008-05-14T05:00:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hasch2o](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@hasch2o](https://forum.kirupa.com/u/hasch2o)\
**Post date:** [May 14, 2008, 5:07am UTC](https://forum.kirupa.com/t/calendar/260277/4 "2008-05-14T05:07:31Z")

</div>

I can try

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

```auto

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”?
