A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Multiline labels in the radio button component -

  1. #1
    Lord of the Singhs
    Join Date
    Mar 2002

    Multiline labels in the radio button component -

    I sincerely thank Becky Sowada on the Macromedia Forums for providing me with invaluable help to this post. Here is wht u have to do to make the text multiline in the radio button component.

    You actually have to hack the RadioButtonComponent code. To do that:

    1. Open your Library
    2. Open the Flash UI Components folder.
    3. Double-click the RadioButton to edit it (the RadioButton must be in your movie somewhere to appear in the library).
    4. Go to the actions panel when edit.
    5. Search for "FRadioButtonClass.prototype.txtFormat". (Ctrl + F will bring up a Find window for you to make this easier).
    6. Add/modify the following code. Basically, pay attention to the lines between the 2 commented lines.

    FRadioButtonClass.prototype.txtFormat = function( pos ) 
            var txtS = this.textStyle; 
            var sTbl = this.styleTable; 
            txtS.align = (sTbl.textAlign.value == undefined) ? txtS.align = pos : undefined; 
            txtS.leftMargin = (sTbl.textLeftMargin.value == undefined) ? txtS.leftMargin = 0 : undefined; 
            txtS.rightMargin = (sTbl.textRightMargin.value == undefined) ? txtS.rightMargin = 0 : undefined 
            // ************************************************************ 
            this.fLabel_mc.labelField.multiline = true; 
            this.fLabel_mc.labelField.wordWrap = true; 
            this.fLabel_mc.labelField.autoSize = true; 
            if(this.flabel_mc._height > this.height){ 
            // ************************************************************ 
    Note that this will only apply for the Radio Buttons in this particular movie. You can copy the RadioButton from this library to other libraries, if you want to have the same behavior in other movies.

  2. #2
    Junior Member
    Join Date
    Sep 2008
    How does one do this "hack" with Flash CS3? I am having the same problem and cannot figure out how to setup multiline labels with the radio button component.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center