Joseph
Joseph

Reputation: 418

AIR iOS TextField doesn't dispatch mouse or touch events after focussed (AS3)

I'm having a terrible time of getting a TextField, once focussed, to dispatch any mouse related events. On Android, AIR does dispatch mouse events, but nothing in iOS.

Specifically, I'm looking for the MOUSE_DOWN, MOUSE_MOVE, and MOUSE_UP events, or the same touch states.

I've tried setting Mouse and Touch events on the Stage, on the TextField, on objects above the TextField, and even tried NativeApplication.nativeApplication.addEventListener(TouchEvent/MouseEvent), though that last one seems to be a non-starter. I've also tried just watching the Stage.mouseX and mouseY properties, but they go silent once the TextField gets focus.

I'm using Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT out of necessity.

Events are fired if the TextField is not focussed, but I get nothing once it is. ANY help is appreciated!

Upvotes: 0

Views: 709

Answers (2)

Kshitiz Gupta
Kshitiz Gupta

Reputation: 248

Can stagetext fulfill your usecase instead of flash.text.textfield?

Upvotes: 0

Alex Koz.
Alex Koz.

Reputation: 497

It because TextField component (only for iOS) is a couple of two components: 1. When it have no focus or not editable and not selectable - Flash's TextField 2. When it have focus for editing - native iOS's UITextView. It will be shown on the highest layer above you Flash's TextField. For get back Flash's TextField you can use stage.focus (or .setFocus?) method.

Upvotes: 2

Related Questions