mike chambers | about

DRK : Week View Example 1

Friday, April 25, 2003

I have uploaded another component example from Flash UI Component Set 5 on DRK 3. This one uses the Week View component (DRK 3) as well as the Advanced Calendar Component from DRK 2.

<PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="/files/mesh/drk/week_getSelectedDate.swf" quality=high bgcolor=#FFFFFF WIDTH="250" HEIGHT="300" NAME="week_getSelectedDate" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>

This example is included on the DRK (one of the 66 component sample files).

You can view the on-line docs for the Week View componenthere.

You can find more information about the Flash UI Component Set 5 (which includes the Week View component) here.

You can find more information about DRK 3 here.

Here is the code:

//Set up the arrays of French day and month abbreviations.
var days_fr = ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"];
var months_fr = ["Jan", "Fev", "Mar", "Avr", "Mai", "Jui", "Jui",
				 "Aou", "Sep", "Oct", "Nov", "Dec"];

//store the english day and month abbreviations
var days_en = myWeekView_wkv.getDayArray();
var months_en = myWeekView_wkv.getMonthArray();

//this function sets the new languages for the components.
function setLanguage(lan)
{
	myWeekView_wkv.setDayArray(this["days_" + lan]);
	myWeekView_wkv.setMonthArray(this["months_" + lan]);
	
	myCalendar.setMonthNames(this["months_" + lan]);
}

//make sure the initial value matches the combo box.
setLanguage(language_cb.getValue());

//change handler for combo box
function onLanguageChange()
{
	var lan = language_cb.getValue();
	setLanguage(lan);
}

language_cb.setChangeHandler("onLanguageChange");

//change handler for week view component
function onWeekChange()
{
	var selectedDate = myWeekView_wkv.getSelectedDate();
	myCalendar.setSelectedItem(selectedDate);
	myCalendar.setDisplayedMonth(selectedDate);
}

//change handler for calendar component
function onCalendarChange()
{
	var selectedDate = myCalendar.getSelectedItem();
	myWeekView_wkv.setSelectedDate(selectedDate);
	
}

myCalendar.setChangeHandler("onCalendarChange");
myWeekView_wkv.setChangeHandler("onWeekChange");

//make sure both calendar components are synced up.
onWeekChange();
twitter github flickr behance