var urls:Dictionary = new Dictionary();
urls[button0_btn] = "url0";
urls[button1_btn] = "url1";
urls[button2_btn] = "url3";
button0_btn.addEventListener(MouseEvent.CLICK, onClick);
button1_btn.addEventListener(MouseEvent.CLICK, onClick);
button2_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(evt:MouseEvent):void{
trace(urls[evt.target]);
}
eventlistener with params use Dictionary
2012年11月7日 星期三 by Hu, Ching-Hsiang
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言