The virtual keyboard appears automatically when a user touches an input text field. If the text field sits within the region used by the keyboard, then the stage will automatically pan to prevent the text field from being obscured. However, it is possible to switch off this default behavior and modify the layout yourself in response to the keyboard being activated.
The steps covered here are applicable only to those using Flash Professional CS5.5 and AIR 2.6 or above.
An FLA has been provided as a starting point.
From the book's accompanying code bundle, open chapter7\recipe5\recipe.fla
into Flash Professional.
Centered on the stage is an input text field named field
. We will write some ActionScript to reposition this text field when the virtual keyboard is activated.