I have to create the image object using something like this
[Embed("/assets/images/Header.png")]
public static var HeaderIcon:Class;
but now the string within embedd is dynamically brought from some xml
like xmlObject.child("icon"); which I tried it like
[Embed(xmlObject.child('icon').toString())]
public static var HeaderIcon:Class;
However it gives errors like
invalid metadata
I am using the above code in action script(as is obvious)
Is there any way to solve this?
You need to use the Loader class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html
It’s a bit more complicated than with embedded resources, but there are good examples in the documentation.