all groups > macromedia flash flash remoting > april 2006 >
You're in the

macromedia flash flash remoting

group:

LoadVars can't access URL - then freezes


LoadVars can't access URL - then freezes Ayman A. R.
4/20/2006 2:05:41 PM
macromedia flash flash remoting:
Hi,

Guys did that ever happen to any of you before? You use a loadVars object (or
even a loadVariables object) to get some data from a URL , but the server of
that URL is down (or some kind of problem is happening with it),,.. and then
it's as if your flash movie is just looping forever to get it?

Ofcourse, you then get the window saying something like "A script in this
movie is letting your movie stop working. Do you want to abort the script" more
or less.

Is there some kind of timeout function that I can use, in case loadVars can't
access that URL, then it just breaks, and continues normally????? Ofcourse,
giving a bad URL , will just give an onLoad event, with a "false" parameter,
indicating that the URL wasn't loaded successfully.. but I'm talking about when
the URL actually exists, but say the server is startign up, or there is a
problem with, say, the Apache server on there... or something.

I hope my problem is clear.
Re: LoadVars can't access URL - then freezes sneakyimp
4/20/2006 8:07:14 PM
in your code that calls the url, right before that line that does the
sendAndLoad() or whatever, set an interval. then call clearInterval in both
your vars' onLoad handler and also the timeout handling function

look up setInterval() in the actionscript language reference.
AddThis Social Bookmark Button