Interesting. I get why you would want that. States are declared as part of the document. So “icon.about” tells the compiler to set the icon when the MXML file changes currentState to “about”. The Button skin, if it were defined in MXML, would have the “up” state, not necessarily the MXML file that contains the Button. The generated code in the containing MXML doesn’t know anything about Button’s skin’s states since even the skin itself can be assigned at runtime or via CSS. Feels a bit like piercing an abstraction boundary, but I get that CSS lets you do it. Does it feel too unnatural to have to use icon.up in the Button’s skin?
-Alex On 3/7/15, 9:34 PM, "OmPrakash Muppirala" <bigosma...@gmail.com> wrote: >This sounds like a fantastic idea. It would be a bonus if we could get >the >same state names auto-complete feature to work in CSS as well. > >Thanks, >Om >On Mar 7, 2015 8:08 PM, "jude" <flexcapaci...@gmail.com> wrote: > >> In CSS you can address certain states of a component using pseudo states >> (states) like so: >> >> s|Button#iconOnlyButton:up { >> icon: "assets/upImage.png"; >> } >> s|Button#iconOnlyButton:over { >> icon: "assets/overImage.png"; >> } >> s|Button#iconOnlyButton:down { >> icon: "assets/downImage.png"; >> } >> >> But you can't do the same thing in MXML. >> >> You *can* address document level states in MXML like so: >> >> <s:Button icon="default.png" icon.about="about.png"/> >> >> <s:states> >> <s:State name="home" /> >> <s:State name="gallery" /> >> <s:State name="feedback" /> >> </s:states> >> >> But that doesn't let you assign values to states of the component. This >> will throw an error: >> >> <s:Button icon="default.png" icon.up="about.png"/> >> >> While this CSS will not: >> >> s|Button#iconOnlyButton:up { >> icon: "about.png"; >> } >> >> Is it possible to add support for inline pseudo states like we do with >>CSS? >> Does anyone else want this? How would we do it? >> >> Jude >>