SimpleCalendarModul

Package:
Class:
Inheritance:
biz.flashscript.components.simplecalendar
public class SimpleCalendarModul
AbstractCalendar extends Sprite
The SimpleCalendarModul class is the base class for the SimpleCalendar component. To create an instance of the SimpleCalendar component place an instance of the component on the main timeline or call the SimpleCalendarModul class (see example on this page).
Public Properties
Property Defined By
dayColor : uint
Defines the backgroundcolor for the textfield containing the number.
SimpleCalendarModul
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.

SimpleCalendarModul

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.

SimpleCalendarModul
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.

Implementation

public function get dayColor():uint
public function set dayColor(value:uint):void
Constructor Detail
SimpleCalendarModul ()  Constructor
public function SimpleCalendarModul()
Creates a new instance of the SimpleCalendarModul.
Event Detail

getSelectedDate event

Event Object Type: biz.flashscript.components.simplecalendar
Event.type property = biz.flashscript.components.simplecalendar.SimpleCalendarModul.GET_SELECTED_DATE

Dispatched when the day buttons are pressed.

getCurrentDate event

Event Object Type: biz.flashscript.components.simplecalendar
Event.type property = biz.flashscript.components.simplecalendar.SimpleCalendarModul.GET_CURRENT_DATE

Dispatched when the SimpleCalendarModul initiates.

Examples
Create a new fla file and name it SimpleCalendarExample.fla. Save the file in the same folder where the biz folder is located. Drag an instance of the SimpleCalendar component on stage from the component menu and delete it. Place two textfields and name them myText and myMessage. Then create an Actionscript file, name it SimpleCalendarExample.as and place this script.

package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	import biz.flashscript.components.simplecalendar.SimpleCalendarModul;

	public class SimpleCalendarExample extends Sprite
	{
		public var myText:TextField;
		public var myMessage:TextField;
		public function SimpleCalendarExample ():void
		{
			var myCalendar:SimpleCalendarModul = new SimpleCalendarModul ();
			myCalendar.scaleX = 400/700;
			myCalendar.scaleY = myCalendar.scaleX;
			myCalendar.x = 25;
			myCalendar.y = 120;
			myCalendar.dayColor = String(0xFFFF00);
			addChild (myCalendar);
			//
			// Getting the specific date when day is pressed
			//
			myCalendar.addEventListener (SimpleCalendarModul.GET_SELECTED_DATE, changeHandler);
			//
			// getting the selected month and year;
			//
			myCalendar.addEventListener (SimpleCalendarModul.GET_CURRENT_DATE, addedHandler);
		}
		private function changeHandler (event:Event):void
		{
			var myMonth:int = SimpleCalendarModul.showMonth;
			var myDay:int = SimpleCalendarModul.showDay;
			var myYear:int = SimpleCalendarModul.showYear;
			var myDate:String = "month: " + myMonth + " - " + "day: " + myDay + " - " + myYear;
			myText.text = myDate;
		}
		private function addedHandler (event:Event):void
		{
			var myMonth:int = SimpleCalendarModul.showMonth;
			var myDay:int = SimpleCalendarModul.showDay;//day of the week
			var myYear:int = SimpleCalendarModul.showYear;
			var myDate:String = "month: " + myMonth + " / " + "day: " + myDay + " / " + "year: " + myYear + " (" + "hours: " + SimpleCalendarModul.showHours + " / " + "minutes: " + SimpleCalendarModul.showMin + ")";
			myMessage.text = myDate;
		}
	}
}
Get Adobe Flash player