 import flash.geom.Point;
 
 import mx.events.SandboxMouseEvent;
+import mx.events.FlexEvent;
+import mx.events.ResizeEvent;
 
 import spark.components.Button;
 import spark.events.TrackBaseEvent;

    {
        if (instance == thumb)
        {
            thumb.removeEventListener(MouseEvent.MOUSE_DOWN, 
                                      thumb_mouseDownHandler);
        }
        else if (instance == track)
        {
            track.removeEventListener(MouseEvent.MOUSE_DOWN, 
                                      track_mouseDownHandler);
            track.removeEventListener("updateComplete", 
                                      track_updateCompleteHandler);
            tempTrackSize = NaN;                                      
        }
    }
    

    {
    	removeSystemHandlers(MouseEvent.MOUSE_WHEEL, system_mouseWheelHandler, stage_mouseWheelHandler);
    }
    
    /**
     *  @private
     */
    override protected function updateDisplayList(w:Number, h:Number):void
    {
        super.updateDisplayList(w, h);
        completeTrackLayout();
    }

    //--------------------------------------------------------------------------
    // 
    // Event Handlers
    //
    //--------------------------------------------------------------------------
    
    /**
     *  Set <code>thumbSize</code> to the value of <code>calculateThumbSize()</code>
     *  and then size and position the thumb with <code>sizeThumb()</code> and 
     *  <code>positionThumb</code>.
     *   
     *  We're assuming that the track's skin will layout the thumb at its default size
     *  and position.   
     * 
     *  We complete the layout here, when either the track or thumb
     *  has changed size, or when the track's display list is updated, 
     *  by recomputing the thumb's size and position.  
     * 
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 1.5
     *  @productversion Flex 4
     * 
     */
    protected function completeTrackLayout():void
    {
        thumbSize = calculateThumbSize();
        sizeThumb(thumbSize);
        positionThumb(valueToPosition(value));
    }
    
    /**
     *  @private
     */
    private function track_resizeHandler(event:Event):void
    {
        completeTrackLayout();
    }

    /**
     *  @private
     */
    private function thumb_resizeHandler(event:Event):void
    {
        completeTrackLayout();
    }
    
    /**
     *  @private
     */
    private function thumb_updateCompleteHandler(event:Event):void
    {
        completeTrackLayout();
        thumb.removeEventListener(FlexEvent.UPDATE_COMPLETE, thumb_updateCompleteHandler);
    }
    
    /**
