# Handling a Error opening URL error in flash remoting

**URL:** <https://forum.kirupa.com/t/handling-a-error-opening-url-error-in-flash-remoting/218431>\
**Category:** Uncategorized\
**Created:** [March 7, 2007, 6:29pm UTC](https://forum.kirupa.com/t/handling-a-error-opening-url-error-in-flash-remoting/218431 "2007-03-07T18:29:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)\
**Post date:** [March 7, 2007, 6:29pm UTC](https://forum.kirupa.com/t/handling-a-error-opening-url-error-in-flash-remoting/218431/1 "2007-03-07T18:29:26Z")

</div>

In the following code, I set up and process a user typing in a username and password. The code has handlers for success and failure; but it doesn’t seem to be able to handle a situation where the gateway.php is missing (or the user lost their internet connection). Instead of returning me to (currently) the failure frame, it just sits there and I get _Error opening URL “[http://localhost/amfphp/gateway.php](http://localhost/amfphp/gateway.php)”_ in the output window. Would someone please help me understand how to handle this situation?

```auto

import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;
NetDebug.initialize();

var gatewayUrl:String = "http://localhost/amfphp/gateway.php";
var service = null;

function handleLoginResponse(re:ResultEvent){
    trace("<handleLoginResponse>: we called login succesfully: " + re.result + " Going to loading screen");    
        
    // Authentication Successful
    if( re.result == '0' ) {        
        //showLogin();    
        loadingStatusHolderMC.lsMC.gotoAndPlay("success");
        loadingStatusHolderMC.lsMC.firstName.text = user;
        
    }    
    // Authentication Failure
    else {
        trace( "<handleLoginError>: we caught an error in login: "+re.result);
        //showLogin();
        loadingStatusHolderMC.lsMC.gotoAndStop("failure");        
    }
}
function handleLoginError(re:ResultEvent){
    trace( "<handleLoginError>: we caught an error in login: "+re.result);
}
function login(user, pass){
    trace( "Login for User: "+user);    
    var pc:PendingCall = service.login(user,pass);
    pc.responder = new RelayResponder(this, "handleLoginResponse", "handleLoginError");
    showLogin(); // After hitting ENTER, the code goes here first        
        loadingStatusHolderMC.lsMC.gotoAndStop("loading");
}

```

I am not concerned with the status of my gateway - it works fine - I want to be able to handle an inability to connect to it.  
[COLOR=DarkOrange]_Thanks!_[/COLOR]
