我有一個用動作腳本創建的tlf文本字段。 當我添加文本未被選中沒有TLFTextField的一個tlf文本字段對齊正確問題
format.align = TextFormatAlign.RIGHT;
領域,你必須點擊文本得到FOUCS。
例如鏈接:http://aradon.co.il/test/tlf.html
這裏是代碼:
import fl.text.TLFTextField;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
var format:TextFormat = new TextFormat("Tahoma", 13, 0x0);
format.align = TextFormatAlign.RIGHT;
var _valueField:TLFTextField = new TLFTextField();
_valueField.width = 200;
_valueField.height = 22;
_valueField.x = 20;
_valueField.y = 20;
_valueField.wordWrap = true;
_valueField.multiline = false;
_valueField.type = TextFieldType.INPUT;
_valueField.defaultTextFormat = format;
_valueField.background = true;
_valueField.backgroundColor = 0xc6c6c6;
_valueField.setTextFormat(format);
addChild(_valueField);
_valueField.text = "text";
但是你的問題是什麼?你提供的接縫按預期工作的例子......也許我錯過了一些東西。編輯:好的!我現在知道了,一旦將對齊設置爲右側,單擊背景後,就無法獲得文本框的焦點。 –
看這裏:http://forums.adobe.com/message/3893357/這是我的問題看看答案也測試它自己與高度和字體大小的詭計 – ygaradon
剛剛測試你的代碼,它適用於我的罰款:http://dl.dropbox.com/u/1329053/editableTFAlignRight/test.html –