Aug 30, 2009

Multi Line Buttons in FlexBuilder / FlashBuilder

Recently I have been working on a project where I have to dynamically make a bunch of forms based on Questions and Answers from a SQL database.  This was going along nicely till I requested some real data that was to be used and the answers were much more verbose then I had anticipated causing the radio buttons to not display the text for the answer. What I needed was a multiline radion button.

There is no way to make a multi line button in flex out of the box which is a bit of a shame.

I started extending the button class to make it work how I needed while chatting with Rob Parkhill I got a few minutes into coding my own solution when Rob pointed me to this http://blogs.adobe.com/aharui/2007/04/multiline_buttons.html post by Alex Harui which did exactly what I needed.

The demo shows both the new Multiline Radio button and the same code creating the standard radio button.



Here is the structure for the demo:


The code:

1 comments:

  1. Hi!!:)

    Am I am using Flash builder 4.6. This problem apeared with me too with mobile project. I am making a quiz. Do have any source that is similar as this one but with spark components?

    Thanks
    ReplyDelete