Skip to main content
Participant
March 22, 2012
Question

Textfield not working in air for android

  • March 22, 2012
  • 1 reply
  • 2414 views

Hi,

I have a weird problem. An input text component that works in air for desktop refuses to work in an air for android application.

It draws on the screen as it should but i cant input text. Am i missing something fundamental?

It is kind of hard to log in if i cant enter credentials

Here is the code:

   idFmt1= new TextFormat("arial",18,0x000000);

   idFmt1.align="left";


   _inputText= new TextField();

   _inputText.defaultTextFormat = idFmt1;
   _inputText.x=150;
   _inputText.height = 35;
   _inputText.width= 150;
   _inputText.type = TextFieldType.INPUT;
   _inputText.background = true;
   _inputText.backgroundColor = 0xa0a0a0;
  
   _inputText.text = _initText;
   _inputText.tabEnabled = true;
   _inputText.tabIndex = 1;
   _inputText.displayAsPassword = false;
   _inputText.antiAliasType = flash.text.AntiAliasType.ADVANCED;
   _inputText.embedFonts = true;
   _inputText.alwaysShowSelection = true;
   _inputText.mouseEnabled=true;
   addChild(_inputText);

This topic has been closed for replies.

1 reply

sinious
Legend
March 22, 2012

Try spelling arial with a capital A, so new TextFormat("Arial",18,0x000000). Also try not embedding the font. Android devices should contain Arial.

Participant
March 22, 2012

Hi, thanks for the suggestion.

After a long brisk walk i figured out that it was the dear old friend

  StageDisplayState that had to be set to

 

StageDisplayState.FULL_SCREEN_INTERACTIVE and not

StageDisplayState.FULL_SCREEN.

Why anyone would like a noninteractive app is beyond me, but then again, many things are..

regards,

/Lars

MJD1981
Inspiring
April 8, 2012

I can't seem to get anywhere with capturing text input! I set the "type" to TextFieldType.INPUT  but this is still ignored on both the desktop and the device. If I place an input textield on the scene in Flash, that works in so far as it brings up the Android keyboard - but then nothing you type is of any consequence.

What could I be missing?