Package | flash.net |
Class | public class NetworkInfo |
Inheritance | NetworkInfo EventDispatcher Object |
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
AIR profile support: This feature is supported
on all desktop operating systems and AIR for TV devices, but is not supported on all mobile devices.
You can test for support at run time using the NetworkInfo.isSupported
property. See
AIR Profile Support for more information regarding API support across multiple profiles.
The NetworkInfo object is a singleton. To get the single NetworkInfo object,
use the static NetworkInfo.networkInfo
property. Do not call the class
constructor, new NetworkInfo()
.
Most computers have one or more interfaces, such as a wired and a wireless network interface. Additional interfaces such as VPN, loopback, or virtual interfaces can also be present.
A NetworkInfo object dispatches a change event when the available
interfaces change. Call the findInterfaces()
method to determine the most current network information.
Note: The NativeApplication object also dispatches network change events.
See also
Property | Defined by | ||
---|---|---|---|
constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | ||
disableNetworkChanges : Boolean
Disables the network change detection within AIR.
| NetworkInfo | ||
isSupported : Boolean
[static][read-only]
Indicates whether access to network interface information is supported on the client system.
| NetworkInfo | ||
networkInfo : NetworkInfo
[static][read-only]
The singleton instance of the NetworkInfo object.
| NetworkInfo | ||
permissionStatus : String
[static][read-only]
Determine whether the application has been granted the permission to access NetworkInfo.
| NetworkInfo | ||
prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object |
Method | Defined by | ||
---|---|---|---|
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event.
| EventDispatcher | ||
Dispatches an event into the event flow.
| EventDispatcher | ||
Returns the list of network interfaces associated with this
machine.
| NetworkInfo | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | ||
Indicates whether an object has a specified property defined.
| Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | ||
Indicates whether the specified property exists and is enumerable.
| Object | ||
Removes a listener from the EventDispatcher object.
| EventDispatcher | ||
Sets the availability of a dynamic property for loop operations.
| Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions.
| Object | ||
Returns the string representation of the specified object.
| Object | ||
Returns the primitive value of the specified object.
| Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type.
| EventDispatcher |
Event | Summary | Defined by | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when the network interfaces have changed. | NetworkInfo |
disableNetworkChanges | property |
disableNetworkChanges:Boolean
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51 |
Disables the network change detection within AIR.
This property has been provided to prevent issues caused by overly active network changes which could result in a lot of network change events, as well as potentially causing AIR to disconnect some active socket connections.
Implementation public function get disableNetworkChanges():Boolean
public function set disableNetworkChanges(value:Boolean):void
isSupported | property |
isSupported:Boolean
[read-only]
Runtime version: | AIR 2 |
Indicates whether access to network interface information is supported on the client system.
Implementation public static function get isSupported():Boolean
networkInfo | property |
networkInfo:NetworkInfo
[read-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
The singleton instance of the NetworkInfo object.
Implementation public static function get networkInfo():NetworkInfo
SecurityError — If content running outside the AIR application security
sandbox accesses this property.
|
permissionStatus | property |
permissionStatus:String
[read-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 29.0 |
Determine whether the application has been granted the permission to access NetworkInfo.
Implementation public static function get permissionStatus():String
See also
findInterfaces | () | method |
public function findInterfaces():Vector.<NetworkInterface>
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
Returns the list of network interfaces associated with this machine.
ReturnsVector.<NetworkInterface> — An array of NetworkInterface objects
|
networkChange | event |
flash.events.Event
flash.events.Event.NETWORK_CHANGE
Language version: | ActionScript 3.0 |
Runtime version: | AIR 2 |
Dispatched when the network interfaces have changed.
The Event.NETWORK_CHANGE
constant defines the value of the type
property of a networkChange
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The NativeApplication object. |