Hey, try NativeText if StageText is too difficult to use

StageText gives the possibility to use native text input controller which has more powerful features like auto-complete. But sometime it is just too difficult to use. Some guys from Adobe gives a NativeText class which wraps the StageText and add some fancy features. Here is the description:

NativeText is a wrapper around StageText which makes adding native text input functionality to your ActionScript application much easier. NativeText has the following advantages:
  • It makes StageText feels like it’s part of the display list. You can create an instance of NativeText, give it x and ycoordinates, and add it to the display list just like you would any other display object. All the management of theviewPort is completely encapsulated.
  • It’s easy to add borders. NativeText does the work of drawing borders such that the StageText instance is vertically centered and horizontally bound. You can even change the border’s thickness, color, and corner radius.
  • It’s easy to add content on top because it manages the bitmap swapping for you. NativeText has a function calledfreeze which does all the work of drawing the StageText to a bitmap (including the border), hiding the StageText instance, and positioning the bitmap exactly where the StageText was. Therefore, if you want to place content on top of a NativeText instance (for instance, an alert box), just call the freeze function first, and everything will work perfectly. When you’re done, call unfreeze, and the bitmap is replaced with the StageText instance and disposed of.
  • Support for multi-line text inputs. NativeText supports text fields of one or more lines. Just pass the number of lines of text you want into the constructor (this is the one property that cannot be changed dynamically), and both the border and viewPort will be properly managed for you.
  • Cross platform. The trickiest part of writing NativeText was making sure it rendered properly on all our reference platforms (Mac, Windows, iOS, and Android) which use different fonts, have different sized cursors, etc. NativeText lets you use any font, font size, and border thickness you want, and your text input should render properly and consistently on all supported platforms.



All Platforms

  • Any GPU that doesn’t support Pixel Shader version 2.x or above
    • Intel GMAs that DON’T support Pixel Shader 2.x: 740, i752, IEG, IEG2, GMA 900, GMA 950, GMA 3000, GMA 3100, GMA 3150
  • Chrome VIA Chipset


  • Any graphics driver older than January 1, 2009
  • NVIDIA driver
  • NVIDIA driver
  • Any Intel GMA driver before X.X.10.2021


  • All Intel GMAs
  • ATI Radeon X1600
  • ATI Radeon 2400
  • Firefox 3.6 and earlier
  • Mac OS X 10.5 or earlier
*Only Software fallback is supported on Linux machines
*Intel HD GPU supported fully on Both Mac and Windows