2 Replies Latest reply on May 18, 2011 12:24 PM by mitz11

    Buttons auto-resize in flex 3.5

    mitz11 Level 1

      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().


      Any ideas?