     private function layoutGridElementR(elt:IVisualElement, bounds:Rectangle):void
     {
         if (bounds)
-        {
-            elt.setLayoutBoundsSize(bounds.width, bounds.height);
-            elt.setLayoutBoundsPosition(bounds.x, bounds.y);
-        }
-    }
-    
+            layoutGridElement(elt, bounds.x, bounds.y, bounds.width, bounds.height);
+    }
+    
+    private static const MAX_ELEMENT_SIZE:Number = 8192;
+    private static const ELEMENT_EDGE_PAD:Number = 512;
+    
+
+    /**
+     *  @private
+     *  Set the visual element's layoutBounds size and position.
+     *  
+     *  Attempting to render graphics whose size is larger than MAX_ELEMENT_SIZE can cause the 
+     *  Flash Player to fail.  We reduce the size of visual elements here and preserve
+     *  the visibility of edges.   For example if the element's left edge is not showing,
+     *  then we ensure that it's no more than ELEMENT_EDGE_PAD to the left of the left edge of
+     *  the scrollRect (that's the horizontalScrollPosition).   The unfortunate assumption here
+     *  is that shrinking the size of a visual element in this way will not affect the appearance
+     *  of the part of the element that overlaps the scrollRect.
+     */
     private function layoutGridElement(elt:IVisualElement, x:Number, y:Number, width:Number, height:Number):void
-    {
+    {   
+        if (width > MAX_ELEMENT_SIZE)
+        {
+            const scrollX:Number = horizontalScrollPosition;
+            const gridWidth:Number = grid.getLayoutBoundsWidth();
+            
+            const newX:Number = Math.max(x, scrollX - ELEMENT_EDGE_PAD);
+            const newRight:Number = Math.min(x + width, scrollX + gridWidth + ELEMENT_EDGE_PAD);
+            
+            x = newX;
+            width = newRight - newX;
+        }
+        
+        if (height > MAX_ELEMENT_SIZE)
+        {
+            const scrollY:Number = verticalScrollPosition;
+            const gridHeight:Number = grid.getLayoutBoundsHeight();
+            
+            const newY:Number = Math.max(y, scrollY - ELEMENT_EDGE_PAD);
+            const newBottom:Number = Math.min(y + height, scrollY + gridHeight + ELEMENT_EDGE_PAD);
+            
+            y = newY;
+            height = newBottom - newY;
+        }
+        
         elt.setLayoutBoundsSize(width, height);
         elt.setLayoutBoundsPosition(x, y);
     }

        for each (var elt:IVisualElement in elements)
            freeGridElement(elt);
        elements.length = 0;
    }      
    
    /**
     *  @private

    /**
     *  @private
     *  Move the specified element to the free list after hiding it.  Return true if the 
     *  element was added to the free list (freeElements).   Note that we do not remove
     *  the element from its parent.
     */
    private function freeGridElement(element:IVisualElement):Boolean
    {
