Hello!
I try to embed images in a 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 the 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; // "assets/images/test.png"
}
But how is it possible to 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 someone know this? Or should / can I use stylesheets?
Thanks a lot in advance & Best Regards.