[Flashcoders] TextFieldAutoSize [AS3]

2008-04-01 Thread Stuart (FunkDaWeb)
Hi All

Is there any way to autosize the height of a textfield only? I want to manually 
set the width of a dynamic textbox but have the user increase the size of the 
text via a button. I currently have it working how i need but the textbox cuts 
off the bottom of the text when its bigger than the textbox.

SM
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] TextFieldAutoSize [AS3]

2008-04-01 Thread Cedric Muller

very sketchy idea:

var txtHeight:Number = txtField.textHeight + 4;// (see Flash docs for  
further information on how text is laidout in a TextField object)

txtField.height = txtHeight;

hth,
Cedric


Hi All

Is there any way to autosize the height of a textfield only? I want  
to manually set the width of a dynamic textbox but have the user  
increase the size of the text via a button. I currently have it  
working how i need but the textbox cuts off the bottom of the text  
when its bigger than the textbox.


SM
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] TextFieldAutoSize [AS3]

2008-04-01 Thread Andrew Murphy
You can also do it like this:

var tf:TextField = new TextField();
with(tf){
autoSize = TextFieldAutoSize.LEFT;
wordWrap = true; // width wordWrap set to true it autosizes
// the height to fit the text
w = 300;
text = Blahblahblah yackitty schmackity.
}


Andrew Murphy
Interactive Media Specialist
[EMAIL PROTECTED]

Delvinia
214 King Street West, Suite 214 
Toronto Canada M5H 3S6
P 416.364.1455 ext. 232
F 416.364.9830
W www.delvinia.com

CONFIDENTIALITY NOTICE
This email message may contain privileged or confidential information. If
you are not the intended recipient or received this communication by error,
please notify the sender and delete the message without copying or
disclosing it.

AVIS DE CONFIDENTIALITÉ
Ce message peut contenir de l'information légalement privilégiée ou
confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par
erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en
détruire le contenu sans le communiquer a d'autres ou le reproduire.
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stuart
(FunkDaWeb)
Sent: April 1, 2008 12:33 PM
To: Flash Coders List
Subject: [Flashcoders] TextFieldAutoSize [AS3]

Hi All

Is there any way to autosize the height of a textfield only? I want to
manually set the width of a dynamic textbox but have the user increase the
size of the text via a button. I currently have it working how i need but
the textbox cuts off the bottom of the text when its bigger than the
textbox.

SM
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.3/1354 - Release Date: 01/04/2008
5:38 AM
 

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.3/1354 - Release Date: 01/04/2008
5:38 AM
 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] TextFieldAutoSize [AS3]

2008-04-01 Thread Stuart (FunkDaWeb)
Worked like a charm many thanks! :o)

SM
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] TextFieldAutoSize [AS3]

2008-04-01 Thread EECOLOR
Indeed, if you set the width of a TextField and autoSize to LEFT, it will
automatically resize only the height.


Greetz Erik


On 4/1/08, Andrew Murphy [EMAIL PROTECTED] wrote:

 You can also do it like this:

 var tf:TextField = new TextField();
 with(tf){
 autoSize = TextFieldAutoSize.LEFT;
 wordWrap = true; // width wordWrap set to true it autosizes
 // the height to fit the text
 w = 300;
 text = Blahblahblah yackitty schmackity.
 }

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders