簡體   English   中英

我想從flex容器中獲取父元素

[英]I want to get the parents id from my container in flex

我有一個問題,所以我創建了一個名為Container1.mxml的mxml容器文件

<mx:VBox>
<mx:Label text="{textName}" />
</mx:VBox>

所以當我打電話給它時會有類似的東西

<container:Container1 id="hello" />

然后id將出現在我的標簽文本中。

提前欣賞它。 謝謝

假設你不能只使用text="{this.id}"

在Container1.mxml中,有一個創建完整的偵聽器,該偵聽器調用此函數:

protected function _handleCreate(e:Event):void {
    myTextLabel.text = this.id || "unknown";
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM