DateChooserModul (ONLY commercially available)

Package:
Class:
Inheritance:
biz.flashscript.components.datechooser
public class DateChooserModul
AbstractCalendar extends Sprite
The DateChooserModul class is the base class for the DateChooser component. This component allows to store events and uses images. It is used as part of the EventChooser application. To create an instance of the DateChooser component place an instance of the component on the main timeline or call the DateChooserModul class (see example on this page).
Public Properties
Property Defined By
dayColor : uint
Defines the backgroundcolor for the textfield containing the number.
DateChooserModul
Public Methods
Method Defined By
All inherited methods of the AbstractCalendar class. N/A
Events
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
dayColor:uint [read-write]

This defines the color value for the textfield containg the number of the day.

The default value is 0xBDC6DE.

Implementation

public function get dayColor():uint
public 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
Event.type property = biz.flashscript.components.datechooser.DateChooserModul.GET_SELECTED_DATE

Dispatched when the day buttons are pressed.

getCurrentDate event

Event Object Type: biz.flashscript.components.datechooser
Event.type property = biz.flashscript.components.datechooser.DateChooserModul.GET_CURRENT_DATE

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;
		}
	}
}