views:

356

answers:

2

Hello all, 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?

all the best nG

+1  A: 

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:

ti_title.stage.focus = ti_title;

ti_title.setSelection( ti_title.length , ti_title.length);

worked in displaying the caret.

Thanks for your time.

Cinegod
A: 

you have not solved the real problem yet which is "How to change the caret color to the one that appears in black background"?

ayumilove