 package com.threerings.flash {
 
+import flash.events.Event;
+import flash.events.MouseEvent;
+
 import flash.filters.GlowFilter;
+
+import flash.system.Capabilities;
+import flash.system.System;
 
 import flash.text.TextField;
 import flash.text.TextFieldAutoSize;

        return f;
    }

    protected static function getArg (args :Object, name :String, defVal :* = undefined) :*
    {
        if (args != null && (name in args)) {


public class TextFieldUtil
{
    /** A fudge factor that must be added to a TextField's textWidth when setting the width. */
    public static const WIDTH_PAD :int = 5;

    /** A fudge factor that must be added to a TextField's textHeight when setting the height. */
    public static const HEIGHT_PAD :int = 4;

    /**
     * Create a TextField.
     *
     * args: contains properties with which to initialize the TextField
     */
    public static function createField (
        text :String, args :Object = null, clazz :Class = null) :TextField
    {
        var tf :TextField = (clazz == null) ? new TextField() : TextField(new clazz());
        tf.background = getArg(args, "background", false);
        tf.border = getArg(args, "border", false);
        tf.multiline = getArg(args, "multiline", false);
