         // get the layout element's X and Width
         var eltX:Number;
         var eltWidth:Number;
-        if (virtualLayout)
+        if (useVirtualLayout)
         {
             eltX = llv.start(index);
             eltWidth = llv.getMajorSize(index);
         }
         else 
         {
-            var elt:ILayoutElement = g.getLayoutElementAt(index);
+            var elt:ILayoutElement = g.getElementAt(index);
             if (!elt || !elt.includeInLayout)
                 return 0.0;
             eltX = elt.getLayoutBoundsX();

            if ((reqEltCount != -1) && (eltInLayoutCount >= reqEltCount))
                break;

            if (i < layoutEltCount) // target.numLayoutElements
                var elt:ILayoutElement = layoutTarget.getLayoutElementAt(i);
            else // target.numLayoutElements < requestedElementCount, so "pad"
                elt = typicalLayoutElement;
            if (!elt || !elt.includeInLayout)
                continue;

            llv.defaultMajorSize = typicalWidth;      
        }
        if (layoutTarget)
            llv.length = layoutTarget.numElements;        
        llv.gap = gap;
     }

