I'm working in the 3.5 sdk.
I have a set of buttons, and I have set their .percentHeight and .percentWidth properties in actionscript, so that they will be 20% as wide as their parent container. However, when I put a label into one of these buttons that is too large, it resizes it! According to the documentation here: http://livedocs.adobe.com/flex/3/html/help.html?content=controls_04.html That should not be the case. (look under "sizing a button control").
I would really like it better if I could either get the font size to change and fit in the button, or have the button text field crop the label. I tried making a special button class inherited from the original that has a special resize handler, but ran into a problem - namely, that the button resizes BEFORE calling the resize handler.
I have a custom programmable skin for the buttons, but do not mess with the text field - I only draw the button itself, and I made sure to call super.updateDisplayList().
Oh, and these buttons are in a stretchy, re-sizable parent container, so no static solutions!
I managed to figure it out! Apparently, the label was setting the minwidth property automagically, which was causing my auto-resizing to not shrink the buttons past the point where the label would fit.
I changed minwidth and minheight to 1, and now it works fine.