Problem with an editable TLFTextField with a right align
Hi,
I've been checking out the TLF for a project in hebrew and it has great features but I have a small but very annoying problem :
When I create (even in the Flash IDE) an editable TLFTextField and I set the align to right (or center), the clickable area to set the focus on this text is not where it should be : it's on the right of the textfield.
Has anyone ever had this problem ?
Is there a known solution to get rid of this problem ?
Here's a simple example so you can reproduce the issue.
In this case, if you click on the left part of the textfield, it does not get the focus. If you drag your mouse to the right part of the textfield, the mouse cursor changes and if you click the field gets the focus. The clickable area also extends to the right of the textfield.
package {
import flash.display.MovieClip;
import fl.text.TLFTextField;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.elements.TextFlow;
import flash.text.TextFieldType;
import flashx.textLayout.formats.TextAlign
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
public class Main extends MovieClip {
public function Main() {
var myTLFTextField:TLFTextField = new TLFTextField();
addChild(myTLFTextField);
myTLFTextField.x = 10;
myTLFTextField.y = 10;
myTLFTextField.width = 500;
myTLFTextField.height = 70;
myTLFTextField.type = TextFieldType.INPUT;
myTLFTextField.border = true;
var myFormat:TextLayoutFormat = new TextLayoutFormat();
myFormat.textIndent = 8;
myFormat.color = 0x336633;
myFormat.fontFamily = "Arial, Helvetica, _sans";
myFormat.fontSize = 50;
myFormat.textAlign = TextAlign.CENTER;
var myTextFlow:TextFlow = myTLFTextField.textFlow;
myTextFlow.hostFormat = myFormat;
myTextFlow.flowComposer.updateAllControllers();
}
}
}
Note : The problem occurs only if the height of the textfield is bigger than the font size : if you change the height of the textfield to 50, then it works as it should; The thing is I need a multiline textfield...
Thanks a lot for your help.
