A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: adjust button dimension to text

  1. #1
    Join Date
    Jan 2008

    Question adjust button dimension to text

    i have a dynamic text field onto which one, i should have a buttonclip.

    however, as the text into dynamic field changes size quite often, i would like to automatically adjust the size of button to the dynamic text field.

    I've tried that :
    mybutton.Height = mytext.height;
    mybutton.Width = mytext.width;
    mybutton.x = mytext.x;
    mybutton.y = mytext.y;

    but i does not work well... button does not update to mytext size.
    before i tried :
    mybutton.height = mytext.height;
    mybutton.width = mytext.width;

    but in this case, width and height of mybutton = 0;

    so any idea ?


  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    press the picture...
    You need to add an eventlistener to monitor when the textfield is not "".
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

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