dcsimg
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
    Location
    India
    Posts
    342

    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.

    Code:
    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; 
            this.setHitArea(this._width,this.fLabel_mc._height); 
            if(this.flabel_mc._height > this.height){ 
                    super.setSize(this.width,this.flabel_mc._height); 
            }else{ 
                    super.setSize(this.width,this.height); 
            } 
            // ************************************************************ 
            this.setEnabled(this.enable); 
    }
    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
    Posts
    2
    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