The other day, I was trying to get the icon for a button in flex programmatically for a FlexUnit test. The code I was testing set the icon of a button using setStyle('icon', ICON). I attempted the obvious button.getStyle('icon') in the test, but was surprised that this always returned null.
A little bit of digging revealed that the I needed to go through the style declaration for the button. When changing my test to assert on button.styleDeclaration.getStyle('icon'), I was able to successfully access the icon.
I found this a bit non-intuitive, but fortunately it only involved some investigation and minimal code changes.
