Flash 5 進階課程
|
項目 |
說明、使用方式 |
範例檔 |
|
遮罩的運用 |
反向使用 |
|
|
下載中影片 (影格統一命名) 第一影格: ifFrameLoaded ("場景 1", "q") { nextScene (); play (); } |
最後影格: gotoAndPlay (1); |
拼圖 |
|
計數器 第一影格:time = "60"; 第二影格: if (Number(time) == 0) { tellTarget ("/") { gotoAndPlay ("s"); } gotoAndPlay (1); } /:score = time*200; clock = time; |
計數器、智慧型影片 最後影格: time = time-1; gotoAndPlay ("s"); |
拼圖 |
|
外掛影片 loadMovie ("為為的教學坊1.swf", "a"); |
虛擬目標影片 |
|
|
Swish使用與結合 |
|
|
|
|
|
|
|
事前規劃 |
|
|
|
變數設定、傳遞 |
|
拼圖 |
|
物件運用 |
on (release) { myDate = new Date(); t1 = myDate.getFullYear(); t2 = myDate.getMonth()+1; t3 = myDate.getDate(); tt = "今天是" add String (t1) add "年" add String (t2) add "月" add String (t3) add "日"; } |
|
函數運用1 設定: function squares (i) { i = i*i; return i; } function abss (i) { i = Math.abs (i); return i; } |
使用: on (release) { tt = squares(9); } on (release) { tt = Math.sqrt ( tt ); } |
|
|
函數運用2 設定: function addscore (score) { /:score = /:score+100; } |
加、扣分運用 使用: on (release) { addscore(); } |
|
|
函數運用3 設定: function sss (kk,m) { if ((kk eq "_level0.m7" and m eq "/a7") or (kk eq "_level0.m1" and m eq "/a1")) { f = "true"; } else { f = "false"; } return f; } |
使用: if (Number(n7) == 1) { } else { ssss = /:sss(kk,m); if (ssss=="true") { tellTarget ("/ok") { nextFrame (); play (); n7 = 1; } } } |
拼圖 |
|
影片專屬Action 第一影格: startDrag ("_root.c", true); |
第二影格: if (_root.c.hitTest(_root.a)) { cc = "a"; } else if (_root.c.hitTest(_root.b)) { cc = "b"; } else { cc = ""; } |
|
利用文字變數偵測變數值 第一影格: startDrag ("_root.c", true); |
影片設定: onClipEvent (mouseMove) { if (_root.c.hitTest(_root.a)) { /:cc = "a"; } else if (_root.c.hitTest(_root.b)) { _root.cc = "b"; } else { _root.cc = ""; } } 設定動態文字變數:cc |
|
|
.hittest 和 _droptarget 的差別 第一影格: startDrag ("_root.c", true); |
注意看兩者在其他影片上移動時有何不同? 影片設定: onClipEvent (mouseMove) { /:cd = _root.c._droptarget; if (_root.c._droptarget == "/a") { /:cc = "a"; } else if (_root.c._droptarget == "/b") { _root.cc = "b"; } else if (_root.c._droptarget == "/") { _root.cc = "/"; } else { _root.cc = ""; } } 設定動態文字變數:cc、cd |
|
拼圖 第一影格: if (_root.c._droptarget == "/a1") { /:cc = "a1"; } else if (_root.c._droptarget == "/a2") { _root.cc = "a2"; } else { _root.cc = ""; } |
影片中按鈕: on (press) { startDrag (this, true); /:cd = ""; } on (release) { kk = this; m = getProperty(kk, _droptarget); if (m eq "_level1/a1" or m eq "/a1") { setProperty (kk, _x, getProperty("/a1", _x)); setProperty (kk, _y, getProperty("/a1", _y)); } else if (m eq "_level1/a2" or m eq "/a2") { setProperty (kk, _x, getProperty("/a2", _x)); setProperty (kk, _y, getProperty("/a2", _y)); } /:cd = _root.c._droptarget; stopDrag (); } |
|
|
Ascii 和 code 的不同 |
tt = "ascii=" add Key.getAscii() add " code=" add Key.getCode(); |
|
|
取得按鍵值1 |
on (keyPress "a") { tt = Key.getAscii(); } |
|
|
取得按鍵值2 |
onClipEvent (keyDown) { /:tt = /:tt add chr(Key.getAscii()); } |
|
|
|
|
|
預定課程
|
|
|
|
|
影片互傳變數 |
不能用Post,只能用Get |
|
|
影片互傳變數 |
使用載入影片 |
|
|
|
|
|
|
與ASP結合 |
傳變數給ASP |
|
|
與資料庫結合 |
傳變數給ASP寫入資料庫 |
|
|
與ASP結合2 |
取得ASP網頁變數值 |
|
|
與資料庫結合2 |
取得資料庫資料 |
|
|
密碼保護SWF |
|
|
|
|
|
|