Skip to main content
Known Participant
August 12, 2013
Question

StageText not firing SoftKeyboardEvents

  • August 12, 2013
  • 1 reply
  • 1189 views

I've already filed a bug (3610876) about this but I'm looking for a workaround as I haven't found any.

Basically StageText seems to not listen to SoftKeyboardEvent.ACTIVATE and SoftKeyboardEvent.DEACTIVATE. It is, however, listening to SoftKeyboardEvent.ACTIVATING.

Here's a sample code that reproduces the problem.

package

{

          import flash.display.Sprite;

          import flash.events.SoftKeyboardEvent;

          import flash.geom.Rectangle;

          import flash.text.StageText;

 

          [SWF(width='1024',height='768',backgroundColor='#ffffff',frameRate='25')]

 

          public class SimpleStageText extends Sprite

          {

                    private var myText:StageText;

 

                    public function SimpleStageText()

                    {

                              super();

 

                              myText = new StageText();

 

                              start();

 

                    }

 

                    protected function start():void

                    {

                              myText.stage = this.stage;

                              myText.viewPort = new Rectangle(5,300,100,20);

                              myText.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING,onKeyboardActivating);

                              myText.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE,onKeyboardActivate);

                              myText.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, onKeyboardDeactivate);

                    }

 

                    protected function onKeyboardActivating(event:SoftKeyboardEvent):void

                    {

                              trace("SoftKeyboardActivating");

                    }

 

                    protected function onKeyboardActivate(event:SoftKeyboardEvent):void

                    {

                              trace("SoftKeyboardActivated");

                    }

 

                    protected function onKeyboardDeactivate(event:SoftKeyboardEvent):void

                    {

                              trace("SoftKeyboardDeactivated");

                    }

 

          }

}

Any ideas how to get those handlers to function properly?

Also an additional issue is when the softkeyboard comes up the screen is not panning even though I've set "softKeyboardBehavior" to pan in the -app.xml file.

This topic has been closed for replies.

1 reply

Adobe Employee
August 13, 2013

Could you please share the AIR SDK version and device with OS version you are using? I tried with the latest build available at http://www.adobe.com/devnet/air/air-sdk-download.html with the sample code provided above and it's working fine.

Regards,

Nimit

exprpubAuthor
Known Participant
August 13, 2013

I'm using AIR 3.7.0 build 1860. I'm currently testing on an iPad mini running iOS 6.0.2. I'm updating to 6.1.3 right now to see if anything changes. I'll also give a shot at AIR 3.8, but I have to test everything else in my projects before sticking with it...

Message was edited by: exprpub I've updated the iPad Mini to the latest iOS 6.1.3 and AIR SDK to 3.8 (build 870). Unfortunately the problem persists. Only the handler for SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING is called. The other two handlers are not called at all.