             _scaleGridRight = NaN;
             _scaleGridTop = NaN;
             _scaleGridBottom = NaN;
+            var currentBitmapCreated:Boolean = false;
             
             if (value is Class)
             {
                 var cls:Class = Class(value);
                 value = new cls();
+                currentBitmapCreated = true;
             }
             else if (value is String)
             {

            
            _source = value;
            
            setBitmapData(bitmapData);
        }
    }
    

     *  @private
     *  Utility function that sets the underlying bitmapData property.
     */
    private function setBitmapData(bitmapData:BitmapData, internallyCreated:Boolean = false):void
    {         
        // Clear previous bitmapData
        if (_bitmapData)
        {
            if (bitmapDataCreated) // Dispose the bitmap if we created it
                _bitmapData.dispose();
            _bitmapData = null;
        }
        
        bitmapDataCreated = internallyCreated; 

        _bitmapData = bitmapData;
        
