Pay for Hesitation: DateBase類別

Pages

2008年3月18日 星期二

DateBase類別

之前在寫填寫時間日期, 總是要自己打進去列舉出來, 其實actionscipt早有API裡面早有內建了!
mx.formatters.DateBase裡面.

import mx.collections.ArrayCollection;
import mx.formatters.DateBase;

private function init():void {
comboBox1.dataProvider = new ArrayCollection(DateBase.dayNamesShort);
comboBox2.dataProvider = new ArrayCollection(DateBase.dayNamesLong);
comboBox3.dataProvider = new ArrayCollection(DateBase.monthNamesShort);
comboBox4.dataProvider = new ArrayCollection(DateBase.monthNamesLong);
comboBox5.dataProvider = new ArrayCollection(DateBase.timeOfDay);
}

沒有留言: