Actionscript Help
- Started
- Last post
- 8 Responses
- mongo
i have some buttons composed of a background graphic and text... the text is dynamic.. is there a way for the background graphic to expand depending on the width of the dynamic text??
- ********0
bgrndGraphic_mc._width = myText_txt._width
- ozhanlion0
yes.
one movieclip inside of it, a dynamic textbox labeled tit_txt over your button bg mc that is btn_bg
then on your frame errrr..
tit_txt.text = "yourlabel"
btn_bg._ width = tit_txt._widthsomething like that if I am makin sense.
- ********0
AS YOU WERE
bgrndGraphic_mc._wid th = myText_txt.textWidth
- ********0
the thing is myText_txt._width
will return the width of the TEXTFIELDbut
myText_txt.textWidth will return the width of the TEXT INSIDE the TEXTFIELD.
hope that's clear, sorry if I've confused ;)
- ozhanlion0
don't do that again please.
*fades in the darkness crying.
- ********0
sorry ozhanlion,
I hope your youth helps through the trauma :p
- mongo0
Thanks guys.. i will give these a try
- MiltonGrove0
Make sure your textfield has an instance name and then do:
textFieldName.wordWrap = false; //so your textfield will expand to fit the text.
textFieldName.multiline = false;then set the _width of the backgroundMC = the _width of the MC that contains the textfield