rbz
rbz

Reputation: 769

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

I have an issue, so i created a mxml container file called Container1.mxml that has

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

so when i call it it will be something like

<container:Container1 id="hello" />

then the id will appear in my Label text.

appreciate it in advance. thank you

Upvotes: 0

Views: 234

Answers (1)

Glenn
Glenn

Reputation: 5342

Assuming you can't just use text="{this.id}"?

Inside Container1.mxml, have a creation complete listener that calls this function:

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

Upvotes: 2

Related Questions