Package | air.net |
Class | public class URLMonitor |
Inheritance | URLMonitor ![]() ![]() ![]() |
This class is included in the ServiceMonitorShim.swc file.
To use classes in the air.net package in Flash, you must first drag the ServiceMonitorShim
component from the Components panel to the Library and then add the following
import
statement to your ActionScript 3.0 code:
import air.net.*;
Property | Defined By | ||
---|---|---|---|
![]()
The numeric status codes representing a successful result.
| URLMonitor | ||
![]() | ![]()
Whether the service is currently considered "available".
| ServiceMonitor | |
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
![]() | ![]() [read-only]
The time of the last status update.
| ServiceMonitor | |
![]() | ![]()
The interval, in milliseconds, for polling the server.
| ServiceMonitor | |
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
![]() | ![]() [read-only]
Whether the monitor has been started.
| ServiceMonitor | |
![]() [read-only]
The URLRequest object representing the probe request.
| URLMonitor |
Method | Defined By | ||
---|---|---|---|
Creates a URLMonitor Object for a specified HTTP- or HTTPS-based service.
| URLMonitor | ||
![]() |
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 | |
![]() |
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 | |
![]() |
[static]
Adds public ServiceMonitor methods to a JavaScript constructor function's prototype.
| ServiceMonitor | |
![]() |
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 | |
![]() |
Start the service monitor.
| ServiceMonitor | |
![]() |
Stop monitoring the service.
| ServiceMonitor | |
Returns the string representation of the specified object.
| URLMonitor | ||
![]() |
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 |
Method | Defined By | ||
---|---|---|---|
Attempts to load content from a URL in the background, to check for a
returned HTTP status code.
| URLMonitor |
![]() | property |
acceptableStatusCodes:Array
[read-write]
The numeric status codes representing a successful result.
public function get acceptableStatusCodes():Array
public function set acceptableStatusCodes(value:Array):void
![]() | property |
urlRequest:URLRequest
[read-only]
The URLRequest object representing the probe request.
public function get urlRequest():URLRequest
![]() | () | Constructor |
public function URLMonitor(urlRequest:URLRequest, acceptableStatusCodes:Array = null)
Creates a URLMonitor Object for a specified HTTP- or HTTPS-based service.
After creating a URLMonitor, the caller should call the start()
method to begin monitoring the status of the service.
As with the Timer object, the caller should maintain a reference to the URLMonitor object. Otherwise the runtime could delete the object, thereby ending the monitoring.
A URLRequest parameter specifies the probe request for polling the server.
Typically, the request method will be either "GET"
or "HEAD"
.
urlRequest:URLRequest — The URLRequest object representing a probe request for polling the server.
|
|
acceptableStatusCodes:Array (default = null ) — An array of numeric status codes listing the codes that represent a successful result.
If you do not specify a value for the
|
![]() | () | method |
protected override function checkStatus():void
Attempts to load content from a URL in the background, to check for a returned HTTP status code.
If it receives a status code that is listed in the acceptableStatusCodes
property, the available
property will be set to true
.
If it receives a status code that is not in the acceptableStatusCodes
list, or if there is a security error or I/O error, the available
property will be set to false
.
![]() | () | method |
public override function toString():String
Returns the string representation of the specified object.
Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override
keyword. For example, a subclass of Object implements function toString():String
instead of using an override of the base class.
String — A string representation of the object.
|