简体   繁体   中英

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 ?

Is there any way to handle it, or it can be only controlled by 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. In the handler, update the dynamic field and reposition your cursor based on the 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.

So by increasing that alpha value, I got the cursor color black.

I change the TextField.textColor = OxFFFFFF, the cursor changes into white as well. Works for my case when I need the same color for the blinking cursor and text.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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