开发者

Check for internet connection in Flash?

How do I check for an active internet connection in Flash us开发者_开发知识库ing Actionscript 3?


If you are using AIR, you can use the ServiceMonitor class.

Otherwise you might want to consider rolling your own with a URLLoader coupled with a timer with an exponential backoff.


to expand on martineno's answer about rolling your own using the URLLoader, read about the HTTPStatusEvent in the documentation.

at the end of the document Adobe includes an example for checking for the existence of a file on a server, but the same could be applied to simply check for an internet connection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜