flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Gold <BarryDG...@ca.rr.com>
Subject Skinnable custom component
Date Tue, 25 Feb 2014 21:28:17 GMT
The most complex piece of visual design in my project is the custom 
buttons.  I'm attaching the code for them so you can see how I 
approached it.

Basically, each button is a partly transparent (50%) horizontal bar with 
lettering in the center and a border around it.  The right side of the 
bar extends some distance, gradually fading to 0% via a LinearGradient. 
  The button changes color when hovered over.

The ButtonStyles object is just a wrapper around an array of parameters, 
that specify the dimensions, color, margin, etc. of the buttons, so that 
I can have several different kinds of buttons, all drawn by the same 
base class.

But I've been reviewing the book I'm learning from, and it talks about 
custom and skinnable components.  And I'm wondering if I really need all 
this code.  Maybe I can do all this with a skinnable custom component 
instead?  Then I can statically "draw" the main menu and list of options 
in MXML.  That's one of my goals: to make as much of the layout/visual 
component of the project static as possible.

What do people think?  Is this doable?  Is it any simpler than the class 
I wrote?  Or does it make things more complex instead of simpler?

View raw message