Had the usual problems with autoSize on fonts today in Flash Pro 8 and Actionscript 2.0. After making a text box react to content length and reposition itself vertically (I wish Flash could do that like DTP software does) using code, I found some text was always cut off at the end of the paragraph.
After some experimentation, I found the following solution: Applying a leading command in code sorts it out, width and wordwrap values obviously contribute. Hopefully the code below will help anyone else that has the same problem. The border command is useful to show whats going on with the size of the text box.
var my_fmt:TextFormat = new TextFormat();
my_fmt.leading = 0;
description1.setTextFormat(my_fmt);
description1.wordWrap=true;
description1._width=453.2;
description1._height=300;
description1.border=true;
description1.autoSize="center";
About Me
- derekcfoley
- Derek lives in Wall Street, Lee-Over-Sands, St Osyth. A mobile and event software/product designer by trade - and is keen to improve things for all the local residents - and has lived in this idyllic location since 2009.
Tuesday, 10 August 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment