Can as3 detect an internet connection?

is it possable for as3 to detect an internet connection?

flash.net package has a read-only property called connect

i did this and it returned true for me

trace(this.connected=true);

by using trace(this.connected=true); doesnt that set the value to true?

sorry, more like
trace(this.connected==true);
typo mate,
and upon checking it it does work

I strongly doubt that has anything to do with internet connection…

Where are you seeing that info from flash.net package? Can you link to some adobe info where it says that corresponds to ‘viable internetconnection’ ?

[quote=sekasi;2356429]I strongly doubt that has anything to do with internet connection…

Where are you seeing that info from flash.net package? Can you link to some adobe info where it says that corresponds to ‘viable internetconnection’ ?[/quote]

…he’s right
but if you can send a NetworkConnection that mean your connected, this is something i’ll have to look into more, cause now im very interested.

I was thinking about trying to load a text document from a website as my “conection test” if it loads the txt then obviously there is a connection, if not then no. I have no problem doing that but, i dont wana send a url request each time my app starts. just a simple t / f would be suffice for what im doing.

[QUOTE=GrndMasterFlash;2356358]flash.net package has a read-only property called connect

i did this and it returned true for me

trace(this.connected=true);[/QUOTE]

Actually…

Amarghosh asks a good question. You can’t access remote servers from local files with the standalone player, and if it’s on your server, why do you need to check?

[QUOTE=amarghosh;2356714]even if the network is available, can an swf on the local file system access network?
i thought it will throw security sandbox errors;

and if it is on the network, y do u wanna check, as the site wouldn’t have loaded at the first place;[/QUOTE]

im working on a screen saver actualy and i want to detect if a web connection is available. if it is i can connect to my xml file if its not ill have a default movie play.

Just go ahead and attempt to load the XML, if the load fails for any reason - internet connection or otherwise - play the default movie.

I remember trying an example from Adobe’s AS3 help that loaded a remote image (some flowers I think it was?) in… from my local computer. However, this was within the Flash IDE - I hadn’t tested it stand-alone. Not sure what that says about the security sandbox :wink: