 import flash.errors.IllegalOperationError;
 import flash.events.EventDispatcher;
 import flash.events.TimerEvent;
+import flash.utils.getDefinitionByName;
 import flash.utils.Timer;
 
 import mx.collections.ArrayCollection;

    {
        var timer:Timer = null;
        
        // Special-case retry on current URI.
        if (_previouslyConnected)
        {
            _previouslyConnected = false;
            setReconnecting(true);
            timer = new Timer(1, 1);
            timer.addEventListener(TimerEvent.TIMER, reconnect);
            timer.start();
            return; // Exit early - if this fails the remaining failoverURIs will be tried next.
        }
        
        // General failover handling.

    private function reconnect(event:TimerEvent):void
    {
        internalConnect();
    }

    /**
     *  @private
     *  Cleanup following a reliable reconnect attempt.
     */
    private function reliableReconnectCleanup():void
    {
        reliableReconnectDuration = -1;
        _reliableReconnectBeginTimestamp = 0;
        _reliableReconnectLastTimestamp = 0;
        _reliableReconnectAttempts = 0;
    }
    
    /**
