     /**
      *  The resizeMode determines how the bitmap fills in the dimensions.
      * 
-     *  When set to <code>BitmapResizeMode.NORMAL</code>, the bitmap will
-     *  end at the edge of the region.
+     *  When set to <code>BitmapResizeMode.NORMAL</code>, the bitmap
+     *  ends at the edge of the region.
      * 
-     *  When set to <code>BitmapResizeMode.REPEAT</code>, the bitmap will
-     *  be repeated to fill the region.
+     *  When set to <code>BitmapResizeMode.REPEAT</code>, the bitmap 
+     *  repeats to fill the region.
      *
-     *  When set to <code>BitmapResizeMode.SCALE</code>, the bitmap will
-     *  stretch to fill the region.
+     *  When set to <code>BitmapResizeMode.SCALE</code>, the bitmap
+     *  stretches to fill the region.
      * 
      *  @default <code>BitmapResizeMode.NORMAL</code>
      */

     *  @see flash.display.Bitmap
     *  @see flash.display.BitmapData
     *  @see mx.graphics.BitmapFill
	 */
	public function get source():Object
	{
		return _fill.source;
	}
	
    /**
     *  @private
     */
	public function set source(value:Object):void
	{
		var oldValue:Object = _fill.source;
		
		if (value != oldValue)
		{
			var bitmapData:BitmapData;
			var tmpSprite:DisplayObject;
			
			// This code stolen from BitmapFill. The only change is to make the BitmapData transparent.
			if (value is Class)
			{
				var cls:Class = Class(value);
				tmpSprite = new cls();
			}
			else if (value is BitmapData)
			{
				bitmapData = value as BitmapData;
			}
			else if (value is Bitmap)
			{
				bitmapData = value.bitmapData;
			}
			else if (value is DisplayObject)
			{
				tmpSprite = value as DisplayObject;
			}
			else if (value is String)
			{
				var tmpClass:Class = Class(getDefinitionByName(String(value)));
				tmpSprite = new tmpClass();
			}
			else
			{
				return;
			}
			
			if (!bitmapData && tmpSprite)
			{
				bitmapData = new BitmapData(tmpSprite.width, tmpSprite.height, true, 0);
				bitmapData.draw(tmpSprite, new Matrix());
			}		
			
			_fill.source = bitmapData;
			dispatchPropertyChangeEvent("source", oldValue, value);
			invalidateSize();
			invalidateDisplayList();
		}
	}
	
	//----------------------------------
	//  smooth
	//----------------------------------

	private var _smooth:Boolean = false;

	[Inspectable(category="General")]	
	
	/**
     *  @copy flash.display.GraphicsBitmapFill#smooth
	 *
	 *  @default false
	 */
	public function set smooth(value:Boolean):void
	{
		if (value != _smooth)
		{
			_smooth = value;
			invalidateDisplayList();
		}
	}
	
    /**
     *  @private
     */
	public function get  smooth():Boolean
	{
		return _smooth;
	}
	
	//--------------------------------------------------------------------------
	//
	//  IGraphicElement Implementation
	//
	//--------------------------------------------------------------------------
	
	/**
	 *  @inheritDoc
	 */
    override protected function measure():void
    {
        measuredWidth = source ? source.width : 0;
        measuredHeight = source ? source.height : 0;
    }
	
	/**
	 *  @inheritDoc
	 */
    override protected function updateDisplayList(unscaledWidth:Number, 
                                                  unscaledHeight:Number):void
	{
	    /* if (!displayObject || !(displayObject is Sprite))
	        return; */

        if (displayObject is Sprite)
            Sprite(displayObject).graphics.clear();
        else if (displayObject is Shape)
            Shape(displayObject).graphics.clear();

	    var g:Graphics = Sprite(drawnDisplayObject).graphics;
	    
		g.lineStyle();
		_fill.offsetX = drawX;
		_fill.offsetY = drawY;
		_fill.smooth = smooth;
		_fill.repeat = false;
		_fill.scaleX = 1;
		_fill.scaleY = 1;
		var fillWidth:Number;
		var fillHeight:Number;

        switch(_resizeMode)
        {

        } 
    }

    //----------------------------------
    //  repeat
    //----------------------------------

    [Bindable("propertyChange")]
    [Inspectable(category="General")]

    /**
     *  Whether the bitmap is repeated to fill the area. Set to <code>true</code> to cause 
     *  the fill to tile outward to the edges of the filled region. 
     *  Set to <code>false</code> to end the fill at the edge of the region.
     *
     *  @default true
     */
    public function get repeat():Boolean 
    {
        return _resizeMode == _REPEAT_UINT;
    }
    
    /**
     *  @private
     */
    public function set repeat(value:Boolean):void
    {
        var oldValue:Boolean = repeat;
        
        if (value != oldValue)
        {
            resizeMode = value ? BitmapResizeMode.REPEAT : BitmapResizeMode.NORMAL;  
            invalidateDisplayList();
            dispatchPropertyChangeEvent("repeat", oldValue, value);
        }
    }

    //----------------------------------
    //  source
    //----------------------------------

    [Bindable("propertyChange")]
    [Inspectable(category="General")]

    /**
     *  The source used for the bitmap fill. The fill can render from various graphical 
     *  sources, including the following: 
     *  <ul>
     *   <li>A Bitmap or BitmapData instance.</li>
     *   <li>A class representing a subclass of DisplayObject. The BitmapFill instantiates 
     *       the class and creates a bitmap rendering of it.</li>
     *   <li>An instance of a DisplayObject. The BitmapFill copies it into a Bitmap for filling.</li>
     *   <li>The name of a subclass of DisplayObject. The BitmapFill loads the class, instantiates it, 
     *       and creates a bitmap rendering of it.</li>
     *  </ul>
     *  
     *  <p>If you use an image file for the source, it can be of type PNG, GIF, or JPG.</p>
     *  
