Flash UI Components have many different styles to set, which require passing a string name to the setter method. while this certainly is not challenging, the use of a constants class would be beneficial but i can’t find one.
is there no constants class available with all of the possible style settings?
From the looks of it the simple answer is no and it makes sense. It appears the setter and getter work by accessing the (sometimes) unique and non-unique properties of the object in question like an associative array value. Like so:
So having a list of constants would be like having a huge list of all the various properties on all objects inheriting from UIComponent. Not only would this be a huge cluttered list but the existence of such a thing would be contrary to the ideals of the flash team when developing these things. The flash team takes a stance of “we don’t want to hold your hand and do it all for you” to promote the freedom to invent things yourself. Take a look at the molehill API’s for example. Adobe did not build a 3D engine for the flash community, but rather exposed the ability for people to do it themselves. So generally with these types of things you can safely judge if they exist or not just by judging with the question “would this be too convenient?” Or, if in doubt, you can always check the as3 docs. Go to the method in question, in this case, setStyle, and if the params for this accept a string that has preset values in constants, the docs will tell you. 🙂
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/core/UIComponent.html#setStyle()