Call me silly (not to my face) but as far as I know autoSize works perfectly well on multiline textfields, the only caveat is that you actually have to write it properly

'autoSize' instead of 'autosize' (notice the capital 'S')

Keep in mind that with centered text the textfield will only size in the vertical not in the horizontal.


cheers,
mario



Quoting Jake Prime <[EMAIL PROTECTED]>:

Autosize doesn't work in multiline textfields. If you think about it,
when you set autosize to true (or "right" or "center") you are asking
Flash to shrink the textfield to the smallest size possible to fit the
text. This is fine in a single line textfield, but with a mulitline
field Flash won't know whether to make the field shorter, narrower or
a combination.

As Giles has mentioned, use TextFormat.align:

var format:TextFormat = new TextFormat();
format.align = "center";
subhead.setTextFormat( format );

Jake

On 10/10/06, Keith Reinfeld <[EMAIL PROTECTED]> wrote:
Blake,

Use the paragraph tag's align attribute:

htmlText='<p align="center"><font face="KnockoutHTF51Middleweight" size="16"
color="#ffffff">SI.com\'s Peter King says T.O. is going to explode
before long, but Dallas is tough enough to survive.</font></p>';


-Keith
http://home.mn.rr.com/keithreinfeld



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Perdue,
Blake
Sent: Tuesday, October 10, 2006 10:26 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Center align multiline textfield?

I'm trying to get a multiline textfield to be center aligned. Here's the
code:

this.createTextField('subhead',20,1,435,434,200);

with (this.subhead) {

           html=true;

           embedFonts=true;

           selectable=false;

           wordWrap=true;

           multiline=true;

           autosize='center';

           htmlText='<font face="KnockoutHTF51Middleweight" size="16"
color="#ffffff">SI.com\'s Peter King says T.O. is going to explode
before long, but Dallas is tough enough to survive.</font>';

}



The autosize seems to only work for single line textfields, not
multiline. Anyone know how to accomplish this? Thanks.



Blake Perdue | 212.522.1292 | AIM: blakepCNN



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to