[flash lite 1.1]月曆

LINEで送る
[`evernote` not found]

第一次用flash lite弄出一個完整的東西
不過由於現在聽說大部分手機都還只支援到flash lite 1.1
不得不去接觸這個跟flash4在同˙一個時代的東西
只能說不習慣之外就是向被廢了武功一樣
很多理所當然的東西都必須另外找解決方案@@
最後總算生出來了

但是….好像沒辦法放在flashplayer中執行
只好僅留程式碼囉~

[第一格]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
fscommand2("SetQuality","high" );
 
//年月日、星期幾用fscommand2取得
nowYear = fscommand2( "GetDateYear" );
nowMonth = fscommand2( "GetDateMonth" );
nowDay = fscommand2( "GetDateDay" );
nowWeek = fscommand2( "GetDateWeekday" );
 
// 每個月的天數?
m1 = 31;
m2 = 28;
m3 = 31;
m4 = 30;
m5 = 31;
m6 = 30;
m7 = 31;
m8 = 31;
m9 = 30;
m10 = 31;
m11 = 30;
m12 = 31;
 
//閏年的計算
 
if(nowYear%4==0){m2=29;}
if(nowYear%100==0){m2=28;}
if(nowYear%400==0){m2=29;}
 
//這個月天數
mcount = eval("m" add nowMonth);
 
//各月的名稱
mname1 = "January";
mname2 = "February";
mname3 = "March";
mname4 = "April";
mname5 = "May";
mname6 = "June";
mname7 = "July";
mname8 = "August";
mname9 = "September";
mname10 = "October";
mname11 = "November";
mname12 = "December";
 
mtitle = eval("mname" add nowMonth);
mtitleN = nowMonth;
ynum = nowYear;

[第二格]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
stop();
 
 
 
//這個月從禮拜幾開始
searchDay = 1;
searchWeek = nowWeek-(nowDay-searchDay)%7;
if (searchWeek<0) {
	searchWeek += 7;
}
firstDayWeek = searchWeek;
 
//日期間的空格
dayInstMargin = 7;
dayInstMarginY = -6
//第一天的MC的移動
day1._x += (day1._width+dayInstMargin)*firstDayWeek;
 
 
//LOOP時的星期識別號
dayWeekNum = firstDayWeek;
 
//第2天開始的mc的複製跟設定
for (i=2; i<=mcount; i++) {
	//複製
	InstName = "day" add i;
	duplicateMovieClip("day" add (i-1), InstName, i);
 
 
 
	//複製後的移動
	_root[InstName]._x += day1._width+dayInstMargin;
 
 
		//複製後的MC所屬的星期
	dayWeekNum++;
	if (dayWeekNum>6) {
		dayWeekNum = 0;
	}
	//周末的處理
	if (dayWeekNum == 0) {
		_root[InstName]._y += day1._height+dayInstMarginY;
		_root[InstName]._x -= (day1._width+dayInstMargin)*7;
	} 
 
 
	//日期的設定
	_root[InstName].daynum = i;
 
}
 
 
//今天的日期MC的移動
duplicateMovieClip("today", "todayMc", 500);
todayMc.daynum = nowDay;
todayMc._x = _root["day" add nowDay]._x;
todayMc._y =  _root["day" add nowDay]._y;