      *  @playerversion AIR 2.5 
      *  @productversion Flex 4.5
      */
-    protected function resizeElement(part:Object, width:Number, height:Number):void
-    {
-        if (part is ILayoutElement)
-        {
-            ILayoutElement(part).setLayoutBoundsSize(width, height, false);
-        }
-        else if (part is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(part).setActualSize(width, height);
+    protected function resizeElement(element:Object, width:Number, height:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).setActualSize(width, height);
         }
         else
         {
-            part.width = width;
-            part.height = height;
+            element.width = width;
+            element.height = height;
+        }
+    }
+    
+    /**
+     *  A helper method to retrieve the preferred width of an element
+     * 
+     *  <p>You can use this method instead of checking for and using
+     *  various interfaces such as ILayoutElement or IFlexDisplayObject.</p>
+     *
+     *  @param element The child to retrieve the width for
+     *
+     *  @see #sizeElement
+     *  @see #getElementPreferredHeight  
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5 
+     *  @productversion Flex 4.5
+     */
+    protected function getElementPreferredWidth(element:Object):Number
+    {
+        if (element is ILayoutElement)
+        {
+            return ILayoutElement(element).getPreferredBoundsWidth();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            return IFlexDisplayObject(element).measuredWidth;
+        }
+        else if (element is StyleableTextField)
+        {
+            // commit styles to get an accurate measurement
+            StyleableTextField(element).commitStyles();
+
+            return StyleableTextField(element).measuredWidth;
+        }
+        else
+        {
+            return element.width;
+        }
+    }
+    
+    /**
+     *  A helper method to retrieve the preferred height of an element
+     * 
+     *  <p>You can use this method instead of checking for and using
+     *  various interfaces such as ILayoutElement or IFlexDisplayObject.</p>
+     *
+     *  @param element The child to retrieve the height for
+     *
+     *  @see #sizeElement
+     *  @see #getElementPreferredWidth 
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5 
+     *  @productversion Flex 4.5
+     */
+    protected function getElementPreferredHeight(element:Object):Number
+    {
+        if (element is ILayoutElement)
+        {
+            return ILayoutElement(element).getPreferredBoundsHeight();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            return IFlexDisplayObject(element).measuredHeight;
+        }
+        else if (element is StyleableTextField)
+        {
+            // commit styles to get an accurate measurement
+            StyleableTextField(element).commitStyles();
+                
+            return StyleableTextField(element).measuredHeight;
+        }
+        else
+        {
+            return element.height;
         }
     }
     

     *  <p>You can use this method instead of checking for and using
     *  various interfaces such as ILayoutElement or IFlexDisplayObject.</p>
     *
     *  @param part The child to position.
     *
     *  @param x The x-coordinate of the child.
     *

     *  <p>You can use this method instead of checking for and using
     *  various interfaces such as ILayoutElement or IFlexDisplayObject.</p>
     *
     *  @param element The child to position.
     *
     *  @param x The width of the child.
     *
