Package com.bit101.components
Class public class Calendar
Inheritance Calendar InheritancePanel InheritanceComponent Inheritance flash.display.Sprite



Public Properties
  Property Defined By
  Inherited color : int
Gets / sets the backgrond color of this panel.
Panel
  Inherited content : Sprite
Container for content added to this panel.
Panel
    day : int
[read-only] Gets the current day.
Calendar
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
  Inherited gridColor : uint
Sets / gets the color of the grid lines.
Panel
  Inherited gridSize : int
Sets / gets the size of the grid.
Panel
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    month : int
[read-only] Gets the current month.
Calendar
    selectedDate : Date
[read-only] Gets the currently selected Date.
Calendar
  Inherited shadow : Boolean
Gets / sets whether or not this Panel will have an inner shadow.
Panel
  Inherited showGrid : Boolean
Sets / gets whether or not the grid will be shown.
Panel
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
    year : int
[read-only] Gets the current year.
Calendar
Protected Properties
  Property Defined By
  Inherited _background : Sprite
Panel
  Inherited _color : int = -1
Panel
    _dateLabel : Label
Calendar
    _day : int
Calendar
    _dayButtons : Array
Calendar
  Inherited _enabled : Boolean = true
Component
  Inherited _gridColor : uint = 0xd0d0d0
Panel
  Inherited _gridSize : int = 10
Panel
  Inherited _height : Number = 0
Component
  Inherited _mask : Sprite
Panel
    _month : int
Calendar
    _monthNames : Array
Calendar
  Inherited Ronda : Class
Component
    _selection : Shape
Calendar
  Inherited _shadow : Boolean = true
Panel
  Inherited _showGrid : Boolean = false
Panel
  Inherited _tag : int = -1
Component
  Inherited _width : Number = 0
Component
    _year : int
Calendar
Public Methods
  Method Defined By
   
Calendar(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0)
Constructor
Calendar
  Inherited
draw():void
[override] Draws the visual ui of the component.
Panel
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
   
setDate(date:Date):void
Displays specified date in calendar by drawing that month and year and highlighting the day.
Calendar
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
   
setYearMonthDay(year:int, month:int, day:int):void
Displays specified date in calendar by drawing that month and year and highlighting the day.
Calendar
Protected Methods
  Method Defined By
   
addChildren():void
[override] Creates and adds the child display objects of this component.
Calendar
  Inherited
drawGrid():void
Panel
   
getEndDay(month:int, year:int):int
Gets the last day of the specfied month and year.
Calendar
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
Calendar
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
   
onDayClick(event:MouseEvent):void
Called when a date button is clicked.
Calendar
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
   
onNextMonth(event:MouseEvent):void
Advances the month forward by one.
Calendar
   
onNextYear(event:MouseEvent):void
Advances the year forward by one.
Calendar
   
onPrevMonth(event:MouseEvent):void
Moves the month back by one.
Calendar
   
onPrevYear(event:MouseEvent):void
Moves the year back by one.
Calendar
Public Constants
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_dateLabel property
protected var _dateLabel:Label

_day property  
protected var _day:int

_dayButtons property  
protected var _dayButtons:Array

_month property  
protected var _month:int

_monthNames property  
protected var _monthNames:Array

_selection property  
protected var _selection:Shape

_year property  
protected var _year:int

day property  
day:int  [read-only]

Gets the current day.


Implementation
    public function get day():int
month property  
month:int  [read-only]

Gets the current month.


Implementation
    public function get month():int
selectedDate property  
selectedDate:Date  [read-only]

Gets the currently selected Date.


Implementation
    public function get selectedDate():Date
year property  
year:int  [read-only]

Gets the current year.


Implementation
    public function get year():int
Constructor Detail
Calendar () Constructor
public function Calendar(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this component.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
Method Detail
addChildren () method
override protected function addChildren():void

Creates and adds the child display objects of this component.

getEndDay () method  
protected function getEndDay(month:int, year:int):int

Gets the last day of the specfied month and year. Needed by layout.

Parameters

month:int — The month to get the last day of.
 
year:int — The year in which the month is in (needed for leap years).

Returns
int — The last day of the month.
init () method  
override protected function init():void

Initializes the component.

onDayClick () method  
protected function onDayClick(event:MouseEvent):void

Called when a date button is clicked. Selects that date.

Parameters

event:MouseEvent
onNextMonth () method  
protected function onNextMonth(event:MouseEvent):void

Advances the month forward by one.

Parameters

event:MouseEvent
onNextYear () method  
protected function onNextYear(event:MouseEvent):void

Advances the year forward by one.

Parameters

event:MouseEvent
onPrevMonth () method  
protected function onPrevMonth(event:MouseEvent):void

Moves the month back by one.

Parameters

event:MouseEvent
onPrevYear () method  
protected function onPrevYear(event:MouseEvent):void

Moves the year back by one.

Parameters

event:MouseEvent
setDate () method  
public function setDate(date:Date):void

Displays specified date in calendar by drawing that month and year and highlighting the day.

Parameters

date:Date — The date to display.
setYearMonthDay () method  
public function setYearMonthDay(year:int, month:int, day:int):void

Displays specified date in calendar by drawing that month and year and highlighting the day.

Parameters

year:int — The year to display.
 
month:int — The month to display.
 
day:int — The day to display.