AIR Mobile TextInput/TextArea Key Events
Another quick one comin at ya!
When working on porting over my very first foray into Flex, my Flex particle engine, to the more current Flex4.6 for mobile purposes, I realized I wasn’t getting key events or change events from a debug Spark TextInput!
@namespace s "library://ns.adobe.com/flex/spark";
Tell your TextInput classes to use the standard TextInputSkin. The same applies for TextAreaSkin.
If we look in our defaults.css for the mobiletheme, we’ll see that it’s normally set to: spark.skins.mobile.StageTextInputSkin.
StageText allows some nice features, such as dictionary completion from the OS and better keyboard support for alternative keyboards, to advanced features like quick zoom and fancy selection support that each OS provides. But it ruins the Events that one would expect that it dispatches.
I don’t know if this is true for ALL events, but certainly it is true for KeyboardEvent.KEY_UP, KeyboardEvent.KEY_DOWN, and Event.CHANGE. Bummer!
In my case, the loss of the native features isn’t that big of a deal right now… Right now.
Eventually we’ll need a formal solution for this if we’re going to rely on StageText at any point.
Oh, and by the way…
My Flex particle engine is working rather well so far on my tablets and phones, even with it’s nasty memory leak!
Once I clean it up, I’ll release a public APK for everyone to test on Android!