I'm creating an Internet app in Flash that will use several
types of screens, and the main user-control element is buttons (For
OK, Advance, Play, etc.)
The standard button "component" doesn't work for me, because
I need a very specific graphical look, with close control over the
exact placement and operation of an icon on the button.
So basically I want to "roll my own" buttons, using the
Button object with my own graphics, and placing a caption and
icon(s) on top. The buttons need to be dynamic, too, so I can
create and delete them at will, change their captions, icons,
What is the best way for me to go about this,
architecturally? My ideas so far:
1) Use symbols for the buttons, and programatically create
labels and graphics to put on top of them. Possible, but highly
annoying, since I have to keep track of the positions of 3 elements
together, for adding, deleting, modifying... I tried putting the
label and graphics in the symbol, until I realized that you can't
modify an individual instance...
2) Create my own component. This looks like a huge hassle,
though, that I'd rather avoid.
Really, I'm just looking for a simple way to create and
modify buttons dynamically with my own special graphics, ideally
without all the overhead of components and everything... Are these
two the only possiblities, or am I missing something else?
create a movieclip with whatever graphics are common to all
your buttons and use a dynamic textfield for the buttons label.
give the textfield an instance name and assign your movieclip to a
class so you can dynamically instantiate it.
if your icons are the different for each movieclip button,
you can just add them as children of their parent movieclip button
when the movieclip buttons are instantiated.