Skip to main content
Participant
October 18, 2011
Question

TLF Input Box Softkeyboard not showing

  • October 18, 2011
  • 1 reply
  • 919 views

I am creating an Android application for Galaxy Tab 10.1, the application uses a editable TLF text in order to grab text in arabic format. When running locally on local pc, it works wonderful and I can grab arabic text, unfortunately, when deployed on my device, the softkeyboard doesnt show up. I tried putting the following:

txtCompanyName.needsSoftKeyboard = true;

but still no luck. Classic Text works fine and triggers the softkeyboard naturally, but it doesnt accept arabic letters. Please advice, thank you guys!

This topic has been closed for replies.

1 reply

Participant
October 18, 2011

tried adding txtCompanyName.requestSoftKeyboard(); but still no luck, is there any fix for this issue?

Nimisha1
Participating Frequently
October 19, 2011

needsSoftKeyboard and requestSoftKeyboard APIs are supported only for flash textfield not for TLF .

Participating Frequently
October 19, 2011

@Nimisha1 -- This used to work on Android (but not iOS). Did we disable it on Android, too?

I just tested on a Xoom and a Nexus One, and the InteractiveObject APIs that control the soft keyboard worked as expected. I didn't test a TLF input box specifically, but TLF text boxes use these InteractiveObject APIs, so this should work.

This is my test code:

package

{

    import flash.desktop.NativeApplication;

    import flash.display.Sprite;

    import flash.display.StageAlign;

    import flash.display.StageScaleMode;

    import flash.events.Event;

    import flash.events.KeyboardEvent;

    import flash.events.MouseEvent;

    import flash.events.TextEvent;

   

    public class InteractiveObjKeyboard extends Sprite

    {

        private var show:Sprite;

        private var hide:Sprite;

        public function InteractiveObjKeyboard()

        {

            super();

           

            // support autoOrients

            stage.align = StageAlign.TOP_LEFT;

            stage.scaleMode = StageScaleMode.NO_SCALE;

           

            show = new Sprite();

            show.graphics.beginFill( 0xff884000 );

            show.graphics.drawRect(0, 0, 400, 100);

            show.x = 50;

            show.y = 50;

           

            show.needsSoftKeyboard = true;

           

            this.addChild( show );

            show.addEventListener( MouseEvent.MOUSE_DOWN, showKeyboard );

            show.addEventListener(TextEvent.TEXT_INPUT, onTyping);

            NativeApplication.nativeApplication.addEventListener( KeyboardEvent.KEY_DOWN, onKeyboard );

            hide = new Sprite();

            hide.graphics.beginFill( 0xffaa3322 );

            hide.graphics.drawRect(0, 0, 400, 100);

            hide.x = 50;

            hide.y = 180;

            this.addChild( hide );

            hide.addEventListener( MouseEvent.MOUSE_DOWN, hideKeyboard );

        }

       

        private function showKeyboard( event:Event ):void

        {

            trace("show");

            stage.focus = show;

        }

       

        private function hideKeyboard( event:Event ):void

        {

            trace("hide");

            this.stage.focus = null;

        }

        private function onTyping( event:TextEvent ):void

        {

            trace("Character typed: " + event.text );

        }

        private function onKeyboard( event:KeyboardEvent ):void

        {

            trace("KeyCode: " + event.keyCode + " CharCode: " + event.charCode + " Char: " + String.fromCharCode(event.charCode) );

        }

    }

}

Message was edited by: Joe ... Ward