A while back, a friend of mine and fellow Flex developer was consulting on a Flex 4 based application. He was having a troublesome issue where in some cases the skin state was not updating in his application when he called invalidateSkinState(). The problem was that when he called invalidateSkinState(), the getCurrentSkinState() was never called during the next commit properties phase (think validation during maturity, eee our whitepaper for more details). It wasn't consistent in the code and it only happened in a few specific cases.
He asked me if I had ever seen the issue where getCurrentSkinState() is skipped after calling invalidateSkinState(). At that time I had never seen a problem with the Skin state not updating, so I didn't have much guidance for him. He found a solution which involved making sure to call both invalidateSkinState() and invalidateProperties() at the same time, even though invalidateSkinState() should also invalidate properties for you.
About three weeks later, I stumbled upon the same issue while working on an application. Inexplicably, one of my components started ignoring invalidateSkinState() and the skin wouldn't change. After setting some breakpoints and screaming at the code for a while I finally figured out what the cause was. I had mistakenly used invalidateSkinState() within the commitProperties() after calling super.commitProperties():
read more...