Flash ile İnternet bağlantısını kontrol etmek

Eskilerden yaptığım birşeyi arar iken karşıma çıkan bir kodu palaşmak istiyorum

var connected:Boolean = false;
function checkConnection():Void {
var myLoadVars:LoadVars = new LoadVars();
 
myLoadVars.onHTTPStatus = function(httpStatus:Number) {
		if (httpStatus != 0) 
			{
				connected = true;
			} 
		else 
			{
				connected = false;
			}
 
		delete this;
	};
	myLoadVars.load("http://www.google.com");
}

teorik olarak google.com u ziyaret edip bir response alıyorsa bağlı oldunuzu boolean türünden döndürüp işleminize devam etmenizi sağlıyabilirsiniz.local bir exe çalışmasında kullanıcının hangi frame ve işlemleri yaptığını log tutmak için kullanılmıştı zamanında :)

This entry was posted on Perşembe, Temmuz 16th, 2009 at 15:24 and is filed under Action Script, Flash. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Leave a Reply