We are a small team of developers building a Flex Application from the scratch with Flex 4 and recently we came across an interesting discussion about the the use of spark skin states. Some of the staff are using constants to declare skin states on the host components and some of them are using regular "strings" according to Adobe components and documentation.
Said that, I'm wondering me if there are any specific reason for why Adobe components are using strings to declare its component's skins state and what are the main benefits within this approach.
Please, share your experiences.
The way I look at it, using constants to define the skin states is not necessary. In fact its probably better not to use them. The reason you would want to use a constant would be if you expect some code other than your skinnable component to reference that information. No class other than the skin and component should have to know anything about the skin states. Any skin classes you create will throw a compilation error if the state names do not match up so you don't need the constants to keep the skin and component 'in sync'.