1
在運行時獲得的ID,我創建組類的多個瞬間,就像這樣:如何從點擊的組件
var groupArtist:Group = new Group();
groupArtist.id = artistXML.id;
groupArtist.width = 150;
groupArtist.height = 170;
groupArtist.clipAndEnableScrolling = true;
groupArtist.layout = new VerticalLayout();
我添加一個事件偵聽:
groupArtist.addEventListener(MouseEvent.CLICK, viewDetails);
這是事件監聽:
private function viewDetails(event:MouseEvent):void
{
Alert.show(event.target.id);
}
但它不工作。我怎樣才能得到被點擊的組的ID? 我已檢查過,並且Id已正確添加到groupinstances中。
這個修好了,謝謝! – Veltar
不客氣!授予正確的答案也是一種非常好的方式來表達感謝。 –
我知道,但我必須等10分鐘,直到我能接受一個。 – Veltar