Actionscript 3 中不显示文本字段插入符号
我正在尝试显示一个其中包含文本的文本字段,并在文本末尾显示闪烁的插入符号。 我已尝试以下操作:
代码:
// ti_title is my textField
stage.focus = ti_title;
ti_title.setSelection( ti_title.length, ti_title.length );
我也已尝试:
// ti_title is my textField
ti_title.stage.focus = ti_title;
ti_title.setSelection( ti_title.length, ti_title.length );
该字段已聚焦,因为我可以在其中输入内容,但在开始输入之前我看不到插入符号。这对于可用性来说不太好。
我什至尝试删除文本然后重新添加它,然后再次设置选择,但仍然不起作用。 有什么想法吗?
I am trying to display a text field that has text inside it, and display the flashing Caret at the end of the text.
I have tried the following:
Code:
// ti_title is my textField
stage.focus = ti_title;
ti_title.setSelection( ti_title.length, ti_title.length );
I have also tried:
// ti_title is my textField
ti_title.stage.focus = ti_title;
ti_title.setSelection( ti_title.length, ti_title.length );
The field is focused because I can type into it, but I do not see a Caret until I have started typing. This is not very good for usability.
I have even tried removing text then re-adding it and then setting the selection again, but still not working.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道我做错了什么。
舞台上原来的文本字段的字体颜色为白色。我将字体颜色更改为黑色,然后出现插入符号。它只是被隐藏在白色背景下。
此代码:
用于显示插入符号。
I figured out what I was doing wrong.
The orginal Textfield on the stage had a Font color of white. I changed the font color to Black and the caret appeared. It was just being hidden against the white background.
This code:
worked in displaying the caret.