简体   繁体   English

如何更改文本输入Flex 4的文本光标颜色?

[英]How to Change Text Cursor Color of Text Input Flex 4?

I want to change the blinking text cursor color of Text Input in Flex 4... How can I change it ? 我想更改Flex 4中“文本输入”的闪烁文本光标颜色。如何更改?

Is there any way to handle it, or it can be only controlled by Flash Player ??? 有什么方法可以处理它,还是只能由Flash Player控制?

I had a similar question about this a while ago. 不久前,我对此也有类似的疑问。 I never found a way to update the actual cursor, so I got creative with the solution. 我从来没有找到更新实际光标的方​​法,所以我对解决方案很有创意。 My solution was to have two textfields stacked. 我的解决方案是将两个文本字段堆叠在一起。 One input field on top of a dynamic field. 在动态字段顶部的一个输入字段。

Set the alpha of the input field to 0. Then, add a CHANGE event listener to the input field. 将输入字段的alpha设置为0。然后,将CHANGE事件侦听器添加到输入字段。 In the handler, update the dynamic field and reposition your cursor based on the textWidth. 在处理程序中,更新动态字段并根据textWidth重新定位光标。

Not ideal, but it did the job. 虽然不理想,但确实可以做到。

I had solved this problem, 我已经解决了这个问题,

Actually there was a problem in skinning of text input. 实际上,在文本输入的皮肤上存在问题。 If we set textinput skin's richeditabletext's alpha to 75 or some down value, flash player makes cursor color white itself. 如果我们将textinput外观的richeditabletext的alpha设置为75或某个向下值,则Flash Player会将光标颜色设置为白色。

So by increasing that alpha value, I got the cursor color black. 因此,通过增加该alpha值,我将光标颜色设置为黑色。

I change the TextField.textColor = OxFFFFFF, the cursor changes into white as well. 我更改TextField.textColor = OxFFFFFF,光标也变为白色。 Works for my case when I need the same color for the blinking cursor and text. 当我需要闪烁的光标和文本使用相同颜色时,适用于我的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM