I want to set an image selected image using the file.browse in an AIR app to be the icon for a button.
My question is to what kind of type do I have to cast it in order to not throw an exception?
If I do:
myBtt.setStyle('icon',pathToImage); // does not work
myBtt.setStyle('icon',imageVariable);// of the Image class, still doesn't work.
How can I do that please?
To my knowledge, an icon for a button should be of type Class. You can't do this in runtime, or it's not that easy.
You can find some topics on this though. Have a look at:
Hope this helps,
There should be an easier way of doing this though.