I am writing a flex 2 that will require a user to interact
with a gui. This gui will display different buttons based on what
the user selects in the same container. I was initially trying to
hide and display the buttons based on visibility attribute, but if
two buttons occupy the same space neither of them display.
There must be a better method, my only thought was states.
states is a good option. You can try using layout containers
and while setting the visibility of the button to false, also set
the the includeInLayout to false. By setting in the includeInLayout
to false, the layout container will make sure the component is not
included while laying out the components in the container.