PDA

View Full Version : input text component font style



GrndMasterFlash
November 12th, 2007, 12:55 PM
ok why does AS3 input text classes suck compared to AS2?

my problem is i have an input text box that needs to get focus, that works:hitman:

but i also want to change to the texts font and align it to center

looking through other threads is saw

answer.setStyle("fontFamily", "Arial");

answer.textField.textAlign = "center";

however the setStyle is an AS2 class of textArea and textField.textAlign doesn't do squat....

any know how to mess with properties of the textField besides the the given AS3 classes...

i have looked through this page and all its related topics and its of no help....
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003499.html

***EDIT***

if some one could show me a way to set the focus to an input textFeild and not use the input textArea component that would also help fix my problem.

jonatas
November 22nd, 2007, 11:15 AM
Create a new TextFormat and set it to the TextInput



var formatOne:TextFormat = new TextFormat();
formatOne.align = TextFormatAlign.CENTER;
formatOne.font = "Arial";
formatOne.color = 0xFFFFFF;
formatOne.size = 20;

var InputOne:TextInput = new TextInput();
InputOne.setStyle("textFormat", formatOne);



hope it helps