Skip to main content
Leafcutter
Inspiring
October 19, 2011
Answered

Confused : Text Input in an Actionscript only project

  • October 19, 2011
  • 1 reply
  • 610 views

Is it possible to get text input in an actionscript only mobile project for Android?  If so is there some example code anywhere? 

I have been trying to get a soft keyboard to appear in the emulator from a TextField but so far no luck (Flex SDK 4.5.1 Air 2.7).  Do I need Air 3.0 and use a Flex project instead of Actionscript?

This topic has been closed for replies.
Correct answer Colin Holgate

What I had in mind was that you would choose the Textfield tool, make sure that it's set to Classic and not TLF, and create the field on the stage.

If you want to make the field using code, then do what you showed, but also do this:

newTextField..type = TextFieldType.INPUT;

Then it will be an input field, and the keyboard should appear when the user touches the field, or if you give it focus.

1 reply

Colin Holgate
Inspiring
October 19, 2011

If you have a Classic textfield, that is an Input field, the keyboard will show up if the user touches the field, or if you set the set.focus to that field.

Leafcutter
Inspiring
October 19, 2011

I am doing the following in code.  Is this what you mean when you say a classic text field? 

newTextField = new TextField();

newTextField.defaultTextFormat = new TextFormat("Arial",useFontSize,0x000000,true,null,null,null,null,TextFormatAlign.LEFT,null,null,null,8);

newTextField.text = "Hello";

this.addChild(newTextField);

Colin Holgate
Colin HolgateCorrect answer
Inspiring
October 19, 2011

What I had in mind was that you would choose the Textfield tool, make sure that it's set to Classic and not TLF, and create the field on the stage.

If you want to make the field using code, then do what you showed, but also do this:

newTextField..type = TextFieldType.INPUT;

Then it will be an input field, and the keyboard should appear when the user touches the field, or if you give it focus.