作者cjcat2266 (CJ Cat)
看板Flash
標題Re: [問題] 關於AS3.0 偵聽事件的函數參數第2問
時間Tue Mar 9 18:29:35 2010
遇到這種情況,我習慣用Dictionary
var strings:Dictionary = new Dictionary();
//你要的對應值在這裡設定
strings[t1_btn] = "35";
strings[t2_btn] = "70";
t1_btn.addEventListener(MouseEvent.CLICK, getSetup);
t2_btn.addEventListener(MouseEvent.CLICK, getSetup);
function getSetpup(e:Event):void {
set.text = strings[e.currentTarget];
}
--
CJ Cat = Croa'J Cat = Cockroach Cat = 西街凱特 = 蜚蠊貓 = 蟑螂貓
Blog
http://cjcat.blogspot.com
Gallery
http://cjcat2266.deviantart.com
ptt2 Board CJWorkshop - 阿多比閃光(Adobe Flash)研討區
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.168.20.21
推 godsing:酷耶! 感謝!! 03/09 21:58
推 sledogerunir:CJ大的好簡潔明瞭(=皿=)""""~ 03/09 22:58