0

I need to use a TLF textfield in a Flash mobile app. How to invoke the softKeyboard on mobile devices for such a TLF textfield? I tried it the way below, but it's not showing up:

import flash.ui.Keyboard; 
import flash.events.KeyboardEvent;
import flash.events.SoftKeyboardEvent;

chat.needsSoftKeyboard = true
chat.requestSoftKeyboard()

(I can't use a "classic textfield" for a couple of reasons)

Tom
  • 5,588
  • 20
  • 77
  • 129

1 Answers1

0

I had the same problem, and now solved it by creating a rect (as shape) and putting it in a Sprite, do it dynamically for each of your TLFTextFields, put the TLF and the Sprite in another container if you want to move it further, be sure to name all of your objects, set a listener to the Sprite, I mean do it as a button and it should provoke e.target.requestSoftKeyboard() of your TLFTextField each time you click or touch it.

tx.requestSoftKeyboard(); tx.textFlow.interactionManager.setFocus(); tx.setSelection(tx.text.length, tx.text.length);

and now put this sp in another (static) Sprite and put the visibility of the Sprite to Flase.

sp.getChildByName(sp.name).visible = false; 
staticSprite=sp;

Finally for deselecting you should call some function like this:

private function deselect(){
        stage.getChildByName(staticSprite.name).visible = true;
}
SAS
  • 1
  • 2