03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Returns a value indicating the status of the most recent HTTP request.<br />

Note: This comm<strong>and</strong> is not supported for BREW devices.<br />

Comm<strong>and</strong> Parameters Value Returned<br />

GetNetworkRequestStatus None -1: The comm<strong>and</strong> is not supported.<br />

0: There is a pending request, a network<br />

connection has been established, the<br />

server's host name has been resolved, <strong>and</strong> a<br />

connection to the server has been made.<br />

1: There is a pending request, <strong>and</strong> a network<br />

connection is being established.<br />

2: There is a pending request, but a network<br />

connection has not yet been established.<br />

3: There is a pending request, a network<br />

connection has been established, <strong>and</strong> the<br />

server's host name is being resolved.<br />

4: The request failed because of a network<br />

error.<br />

5: The request failed because of a failure in<br />

connecting to the server.<br />

6: The server has returned an HTTP error (for<br />

example, 404).<br />

7: The request failed because of a failure in<br />

accessing the DNS server or in resolving the<br />

server name.<br />

8: The request has been successfully fulfilled.<br />

9: The request failed because of a timeout.<br />

10: The request has not yet been made.<br />

Example<br />

The following example assigns the status of the most recent HTTP request to the<br />

requesttatus variable, <strong>and</strong> then uses a switch statement to update a text field with the<br />

status:<br />

requeststatus = fscomm<strong>and</strong>2("GetNetworkRequestStatus");<br />

switch (requeststatus) {<br />

case -1:<br />

_root.myText += "requeststatus not supported" + "\n";<br />

break;<br />

case 0:<br />

_root.myText += "connection to server has been made" + "\n";<br />

break;<br />

case 1:<br />

_root.myText += "connection is being established" + "\n";<br />

break;<br />

218 ActionScript language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!