         _lastSelected = null;
     }
 
-    /**
-     * Utility function for createTextField() and createFormat().
-     */
-    protected static function getArg (args :Object, name :String, defVal :* = undefined) :*
-    {
-        if (args != null && (name in args)) {
-            return args[name];
-        }
-        return defVal;
-    }
-
     /** The last tracked TextField to be selected. */
     protected static var _lastSelected :TextField;
+
+    protected static const MASK_FIELD_PROPS :Object = { outlineColor: true };
+
+    protected static const DEFAULT_FORMAT_PROPS :Object = { size: 18, font: "_sans" };
 }
 }

import flash.text.TextFormat;
import flash.text.TextFormatAlign;

public class TextFieldUtil
{
    /** A fudge factor that must be added to a TextField's textWidth when setting the width. */

    /**
     * Create a TextField.
     *
     * @param initProps contains properties with which to initialize the TextField.
     * Additionally it may contain the following properties:
     *    outlineColor: uint
     *
     * initProps may be destructively modified.
     */
    public static function createField (
        text :String, initProps :Object = null, clazz :Class = null) :TextField
    {
        var tf :TextField = (clazz == null) ? new TextField() : TextField(new clazz());

        if ("outlineColor" in initProps) {
            tf.filters = [ new GlowFilter(uint(initProps["outlineColor"]), 1, 2, 2, 255) ];
        }

        Util.init(tf, initProps, null, MASK_FIELD_PROPS);
        tf.text = text;
        if (tf.autoSize != null) {
            tf.width = tf.textWidth + WIDTH_PAD;
            tf.height = tf.textHeight + HEIGHT_PAD;
        }

        return tf;
    }

    /**
     * Create a TextFormat using initProps.
     * If unspecified, the following properties have default values:
     *  size: 18
     *  font: _sans
     */
    public static function createFormat (initProps :Object) :TextFormat
    {
        var f :TextFormat = new TextFormat();
        Util.init(f, initProps, DEFAULT_FORMAT_PROPS);
        return f;
    }

