Mike Chambers

code = joy

Catching server timeout errors when using Flash Remoting

with 18 comments

When calling remote services / methods via Flash Remoting, any errors that occur will trigger the onStatus method to be called:

onStatus = function(error)
{
     trace(“Error : ” + error.description);
}

However, if Flash cannot connect to the server (network or server is down) onStatus will not be called. Using XML and LoadVars you have to manually keep a timer in order to time out the connection, however you do not have to do this using Flash Remoting. Just create a method like the following:
_global.System.onStatus = function(info)
{
trace(“details : ” + info.details);
trace(“description : ” + info.description);
trace(“code : ” + info.code);
trace(“level : ” + info.level);
}

This method will be called if Flash MX cannot connect to the Flash Remoting server.
Here is an example output (when the server is not running):
details: http://localhost:8500/flashservices/gateway/
description: HTTP: Failed
code: NetConnection.Call.Failed
level: error

Couple of notes :

  • The exact messages may depend on the browser.
  • This will only works when connecting to the server via Flash Remoting. It will not work when using the XML or LoadVars object.

Written by mikechambers

April 29th, 2002 at 9:05 am

Posted in General

18 Responses to 'Catching server timeout errors when using Flash Remoting'

Subscribe to comments with RSS

  1. Hi when I try to connect to the webservice with “http://localhost/dotnet/dotnet.asmx?wsdl“ , I get an error no such service found.

    arshad

    27 Mar 03 at 2:17 am

  2. r u sure that service has been deployed at that url.
    u can check by accessing the same URL from the browser, if the service is deployed u will see the service page

    abhishek

    7 Jul 03 at 5:24 am

  3. plz tell me how call a value from user to server , and same as how pass value pass from server to user..??? in java scripy.

    Plz tell me as soon as possible…

    thanking you.

    vipul

    30 Jul 03 at 6:39 am

  4. Yo !

    If flash mx tells you that there is no service at url requested, there is no service at that url…..so problem lies i your server setup or service itself…

    I know that this is not much help, but a good fact…

    casm

    17 Sep 03 at 2:05 pm

  5. el .fla tiene que estar dentro de un navegador necesariamente?

    the archive .fla into de browser is necesary?
    in debug movie no work , no work in opera and safari. In the explorer is OK time Out 60 seg.

    gustavo

    23 Oct 03 at 12:54 pm

  6. Thats great man, i love it.
    If you are interested you can visit my sites: britney spears nude and also nude celebrities

    nude celebrities

    29 Oct 03 at 9:48 am

  7. Great to have the chance to say that this is a great site. I hope that you have a look at mine, too
    Bye, Dirk

    Noni Juice

    2 Nov 03 at 6:48 pm

  8. I am glad that i found a site where i can get the best informations about the macromedia and their produkts. Many greatings from germany

    noni

    17 Nov 03 at 2:29 am

  9. http://www.tupartido.com.ar is 100%flash remoting and amfphp, thank for your script time out…

    Gustavo brian

    20 Nov 03 at 2:49 pm

  10. thank for your script time out. I´ll test this on my server

    cms

    3 Dec 03 at 6:30 am

  11. Great site that you have opened to all of us. I have learned a lot. Keep up the good work. All the best.

    Noni

    9 Dec 03 at 2:38 pm

  12. I’ve tried using this method with my custom classes that involve remoting…

    I embedded _global.System.onStatus, and it works when i test publish in Flash, but when I open it in the browser, the onStatus seems to be only caught if i export as flash 7, and open it in IE, it did not work with the following:

    Fire Fox(MAC, PC), Safari, IE(When exported as flash 6), has anyone else hit this problem?

    thanks

    shaun

    25 Jun 04 at 4:19 pm

  13. well…I’ve decided to use a timeout of around seven seconds. I just couldn’t seem to get System.onStatus to work with anything but IE

    shaun

    25 Jun 04 at 10:23 pm

  14. This does appear to work in IE but doesn’t work in firefox, any chance its a flash plugin issue when used in firefox ?

    Grant

    7 Sep 05 at 9:36 pm

  15. I integrating flash remoting with Asp.Net ,when my service is in offline flash returning error as Error opening URl .I

    I don’t want to show this error when i work in offline mode ,because i using shared object in offline mode.

    Could you pls help how to hide this Error opening url error for the offline mode.

    Contact Id:
    mailtochandra2000@yahoo.com

    chandrasekaran

    4 Feb 06 at 10:39 pm

  16. I integrating flash remoting with Asp.Net ,when my service is in offline flash returning error as Error opening URl .I

    I don’t want to show this error when i work in offline mode ,because i using shared object in offline mode.

    Could you pls help how to hide this Error opening url error for the offline mode.

    Contact Id:
    mailtochandra2000@yahoo.com

    chandra

    4 Feb 06 at 10:40 pm

  17. hi
    sir , i want to now that cant we trace or save the error “Error opening URL” when it comes in the out put pannel, i am working with .txt file and loading the var from the .txt file but if in the run time there is no text file i want to show the error in a text box please help me with this.

    thanks

    kusha

    23 Jan 07 at 10:22 pm

  18. hi,
    i have build a flash module, which is consuming .NET web service, while calling one of its web method its throwing an error “Unable to connect to endpoint: http://SampleWebservice/Sample1.asmx” (Other web methods are returning expected results), i tried to execute the same web method from browser it works perfectly. After some investigation i found out the cause of error. From the browser web method takes 40 odd seconds to execute and flash module just wait for 15-20 sec to get the result from the web method. now the question arises, how to set the Timeout property for the web service object in flash.

    Any suggestion would be greatly appreciated.

    Thanks,
    Imtiyaz

    Imti

    22 Dec 08 at 4:34 am

Leave a Reply