I think the issue is that you need to namespace all of the styles. So depending on which component your myButton was based off a spark component or a Halo component.
See the following link for more details. http://cookbooks.adobe.com/post_How_to_use_the_new_CSS_syntax_in_Flex_4-15726.html Another good way to do this is to use the style manager built into flash builder, you can apply a style to an instance of a button directly, click the convert to css button and see what the markup for the css looks like. Hope this has been some help, Wes On Fri, Aug 27, 2010 at 10:42 PM, Angelo Anolin <[email protected]>wrote: > > > Anybody? > > Having so much hard time trying to move flex3 to flex4. > > Basically this is a styling issue which is far beyond my expertise. > > If you have a component created named myButton.as, and you created a CSS > file with a style named myButton, that CSS declaration would span all > instances where you used the myButton component. But since Flex4 does not > like that naming convention of CSS, I have had to rename my CSS declaration > to .myButton{}. > > Now, how do I declare the same in my AS component to utilize that style? > > Thanks a lot for any inputs on this. > > ------------------------------ > *From:* Angelo Anolin <[email protected]> > *To:* [email protected] > *Sent:* Fri, 27 August, 2010 10:51:02 > *Subject:* [flexcoders] Where To Declare CSS Style Name in AS Component > > > > Dear FlexCoders, > > In Flex 3, you can simply name your CSS style to the name of the component > you created. For example, you created an AS component named MyNewButton, > hence, in your CSS file, you can declare a style with name MyNewButton and > the component automatically picks up that style. > > But when you use Flex 4, you get an error saying: CSS type selectors are > not supported in components: MyNewButton. > > Modifying the CSS file, let us say the style name MyNewButton has been now > declare as .MyNewButton{}. How do I reference the new style name to be used > by the component? How do I declare it in the AS file? > > Thanks for your inputs. > > Angelo > > > > >

