actionscript 3 - Resizable Button with background in flash CS4 -


I want to create a button that changes dynamically with content. To achieve this, I made a movie clip in the library and included four layers in it - text, bg, shadow and border.

I think if I autosize the textfile, only the size of the text changes and the other things remain as if it is. If I calculate the need of width using the xxxLineMetrics function and it is applied to the button, the background resizes properly, but the text field is also spread with them and looks ugly.

I want the background (textfield's brother)

I hope that people will meet me who I want ... any help appreciated ...

Thanks,

You should apply the calculated width only to BG Movie Clip and for the full movie clip No. Because it will also change the width of the textfield.

Then try to do something like this:

  txt.autoSize = TextFieldAutoSize.LEFT; Txt.text = "label"; Btn.bg.width = txt.width;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -