     private function commitSelectedIndex():Boolean
     {
         // Step 1: make sure the proposed selected index is in range.
-        var maxIndex:int = numItems - 1;
+        var maxIndex:int = dataProvider.length - 1;
         var oldIndex:int = _selectedIndex;
         
         if (_proposedSelectedIndex < NO_SELECTION)
             _proposedSelectedIndex = NO_SELECTION;
         if (_proposedSelectedIndex > maxIndex)
             _proposedSelectedIndex = maxIndex;
-        if (requiresSelection && _proposedSelectedIndex == NO_SELECTION && numItems > 0)
+        if (requiresSelection && _proposedSelectedIndex == NO_SELECTION && dataProvider.length > 0)
             return false;
         
         // Step 2: dispatch the "selectionChanging" event. If preventDefault() is called

 *  The Selector class is the base class for all components that support
 *  selection.
 */
public class Selector extends ItemsComponent
{
    include "../core/Version.as";


        
        // Step 3: commit the selection change
        if (_selectedIndex != NO_SELECTION)
        	itemSelected(dataProvider.getItemAt(_selectedIndex), false);
        if (_proposedSelectedIndex != NO_SELECTION)
        	itemSelected(dataProvider.getItemAt(_proposedSelectedIndex), true);
        _selectedIndex = _proposedSelectedIndex;
        _proposedSelectedIndex = NO_PROPOSED_SELECTION;
        
