I am trying to embed images in mx: tree:
<mx:Tree labelField="name" id="tree"
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')">
</mx:Tree>
This works fine, but I will embed images with a String variable.
I have a variable and a function
[Bindable]
private var folderIcon:String;
public function setIcon(icon:String):void {
folderIcon = icon;
}
But how can I replace these lines
folderOpenIcon="@Embed(source='assets/images/test.png')"
folderClosedIcon="@Embed(source='assets/images/test.png')"
defaultLeafIcon="@Embed(source='assets/images/test.png')"
with
folderIcon
? Does anyone know this? Or should / can I use style sheets?
Many thanks in advance and best regards.
source
share