用AS给自己制作Flash个性月历
2007-12-25 11:13:26 来源:WEB开发网下面的代码,根据不同的节日,高亮显示,你可以按下面的格式,将自己的重要日子加进去。
switch (mon) {
case 0:
jrname = "1元旦"
jrday = (1 + weekday) -1;
showjrday();
break;
case 1:
jrname = "14情人节";
jrday = (14 + weekday) -1;
showjrday();
break;
case 2:
jrname = "8国际妇女节";
jrday = (8 + weekday) -1;
showjrday();
break;
case 3:
jrname = "5清明节";
jrday = (5 + weekday) -1;
showjrday();
break;
case 4:
jrname = "1国际劳动节";
jrday = (1 + weekday) -1;
showjrday();
jrname = "4青年节";
jrday = (4 + weekday) -1;
showjrday()
break;
case 5:
jrname = "1国际儿童节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 6:
jrname = "1建党节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 7:
jrname = "1建军节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 9:
jrname = "1国庆节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 11:
jrname = "25圣诞节";
jrday = (25 + weekday) -1;
showjrday();
break;
}
完了,祝你成功!
代码清单:
var date:Date = new Date();
var year = date.getFullYear ();
var mon = date.getMonth();
var day = date.getDate();
var hh = date.getHours();
var mm = date.getMinutes();
var ss = date.getSeconds();
hh_txt.text = hh;
mm_txt.text = mm;
ss_txt.text = ss;
mon_txt.text = mon + 1
var oneday:Date = new Date(year,mon,1);
var days:Array = [31,28,31,30,31,30,31,31,30,31,30,31];
if (year%4 == 0 year%400 == 0) {
days.splice(1,1, 29);
}
var mondays = days[ mon ];
var weekday = oneday.getDay ();
year_txt.text = year;
function showday () {
var i;
var j = weekday;
for ( i =1;i <= mondays;i++) {
this["d" +j].text = i;
j += 1;
}
var today = (day + weekday) -1;
this["d" + today].textColor
= 0xFF0000;
}
showday();
var jrname;
var jrday;
function showjrday ( ) {
this["d"+jrday].autoSize = TextFieldAutoSize.LEFT;
this["d"+jrday].multiline = true;
this["d"+jrday].wordWrap = true;
this["d"+jrday].text = jrname;
this["d"+jrday].textColor = 0xFF0000;
}
switch (mon) {
case 0:
jrname = "1元旦"
jrday = (1 + weekday) -1;
showjrday();
break;
case 1:
jrname = "14情人节";
jrday = (14 + weekday) -1;
showjrday();
break;
case 2:
jrname = "8国际妇女节";
jrday = (8 + weekday) -1;
showjrday();
break;
case 3:
jrname = "5清明节";
jrday = (5 + weekday) -1;
showjrday();
break;
case 4:
jrname = "1国际劳动节";
jrday = (1 + weekday) -1;
showjrday();
jrname = "4青年节";
jrday = (4 + weekday) -1;
showjrday()
break;
case 5:
jrname = "1国际儿童节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 6:
jrname = "1建党节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 7:
jrname = "1建军节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 9:
jrname = "1国庆节";
jrday = (1 + weekday) -1;
showjrday();
break;
case 11:
jrname = "25圣诞节";
jrday = (25 + weekday) -1;
showjrday();
break;
}
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
- ››asp获取毫秒数
- ››asp.net报“INSERT INTO 语句的语法错误解决
更多精彩
赞助商链接