| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
DateChooserModul |
|
|
| Property | Defined By |
|---|---|
|
dayColor
: uint
Defines the backgroundcolor for the textfield containing the number. |
DateChooserModul |
| Method | Defined By |
|---|---|
| All inherited methods of the AbstractCalendar class. | N/A |
| Event | Defined By |
|---|---|
|
getSelectedDate This event is dispatched when one of the days is pressed. |
DateChooserModul |
|
getCurrentDate This event is dispatched when the current month/year is displayed and when the month is changed. This event is also dispatched when the movie opens and can be caught. The month, the day, the year, the hours and minutes can be displayed. See the example at the bottom how to do it. |
DateChooserModul |
| All inherited events for the AbstractCalendar class. | N/A |
| Property Detail |
|---|
|
dayColor property textFieldColor:String [read-write] This defines the color value for the textfield containg the number of the day. The default value is 0xBDC6DE. Implementationpublic function get dayColor():uintpublic function set dayColor(value:uint):void |
| Constructor Detail |
|---|
|
DateChooserModul () Constructor
public function DateChooserModul() |
| Creates a new instance of the DateChooserModul. |
| Event Detail |
|---|
|
getSelectedDate event
Event Object Type:
biz.flashscript.components.datechooser
Dispatched when the day buttons are pressed. |
|
getCurrentDate event
Event Object Type:
biz.flashscript.components.datechooser
Dispatched when the DateChooserModul initiates. |
| Examples |
|---|
Create a new fla file and name it DateChooser.fla. Save the file in the same folder where the biz folder is located. Drag an instance of the DateChooser component on stage from the component menu and delete it. Then create an Actionscript file, name it Datechooser.as and place this script.
package
{
import flash.display.Sprite;
import flash.events.Event;
import fl.text.TLFTextField;
import biz.flashscript.components.datechooser.DateChooserModul;
public class Datechooser extends Sprite
{
public var myText:TLFTextField;
public var myMessage:TLFTextField;
public function Datechooser ():void
{
var myEventChooser:DateChooserModul=new DateChooserModul();
myEventChooser.scaleX = 0.4;
myEventChooser.scaleY = 0.4;
myEventChooser.x = 25;
myEventChooser.y = 90;
myEventChooser.dayColor = 0xFF0000;
addChild (myEventChooser);
//
// Getting the specific date when day is pressed
//
myEventChooser.addEventListener (DateChooserModul.GET_SELECTED_DATE, changeHandler);
//
// getting the selected month and year;
//
myEventChooser.addEventListener (DateChooserModul.GET_CURRENT_DATE, addedHandler);
}
function changeHandler (event:Event):void
{
var myMonth:int = DateChooserModul.showMonth;
var myDay:int = DateChooserModul.showDay;
var myYear:int = DateChooserModul.showYear;
var myDate:String = "month: " + myMonth + " - " + "day: " + myDay + " - " + myYear;
myText.text = myDate;
}
function addedHandler (event:Event):void
{
var myMonth:int = DateChooserModul.showMonth;
var myDay:int = DateChooserModul.showDay;//day of the week
var myYear:int = DateChooserModul.showYear;
var myDate:String = "month: " + myMonth + " / " + "day: " + myDay + " / " + "year: " + myYear + " (" + "hours: " + DateChooserModul.showHours + " / " + "minutes: " + DateChooserModul.showMin + ")";
myMessage.text = myDate;
}
}
}
|