First, a few words about components. The Flex class, UIComponent, is the base for all components. This example component will extend UIComponent directly – hence my use of the term “from scratch”. Using UIComponent makes sure that the component fits into the Flex framework and plays well with the other components.

I’m sure that you already know that you can create custom components in Flex. I’m also sure that you know that you can use CSS to style your applications and components. Did you know that you can also use styles of your custom component to define styles on elements within that custom component?

Ok, I may have lost some of you there. Lets take a look at my example below… What I am showing here are 2 custom components side by side (example 1 and example 2). They are two separate instances of my “MXML_Example” component. Yes, they look different, but they are the exact same component. Each “MXML_Example” component contains a mx:Panel, mx:TextArea, and mx:Button.

Flexed

Working in the UX team @ Yahoo! R&D, India. I specialize in UI architecture & development. I like traveling - Traveling world wide tasting different cultures and customs. Seeing the miracles of man and nature. What else is our life for?