Skip to main content
September 14, 2010
Question

TLF focus and cursor

  • September 14, 2010
  • 2 replies
  • 1786 views

hi,

can I set the keyboard focus for a TLFTextField? I tried stage.focus = myTLF but there is no cursor...

TIA

This topic has been closed for replies.

2 replies

Participant
August 22, 2012

You may try to assign a new EditManager() to TLFs.textFlow.InteractionManager... then use TLFs.textFlow.InteractionManager.setFocus() it worked for me once... But being hones I'm also stuck with this now.   If you fixed your issues with TLF and now know what to do,  could you please send me a message with at least short description of how it works))

August 22, 2012

I think I used an offstage classic text field for input, send the input to the TLF and handle the focus with my own code. One step before I did this I used the KeyDown event but had problems with some chars/keyboard combinations on a Linux system.

The downside on this is you can't set the cursor and just appeand or delete chars at the end. If you want to make a blinking cursor at the end of the text you can save the input text in a variable and put it with a pipe sign | blinking into the text field.

Participant
August 22, 2012

Thanks a lot Man! I really appreciate this. I'll see what i can come up with

Inspiring
September 14, 2010

How are you testing this? In the testing environment or on a web page? If the testing environment have you "disabled the keyboard shortcuts"?

Also, it used to be that the flash object needed to already have the focus (by having been clicked on) before you would be able to set the focus to a text field. This was a security feature to prevent someone from popping up a swf that looked like a login box and stealing folks ID/Passwords.....

September 15, 2010

I use Air 2.0 and extended Desktop environment. So there shouldn't be a security problem but maybe it is due to what you explained.

Is there realy no way?