-- Lingo syntaxon streamStatusURL,state,bytesSoFar,bytesTotal,errorstatement(s)end// JavaScript syntaxfunction streamStatus(URL,state,bytesSoFar,bytesTotal,error){statement(s);}
System message and event handler; called periodically to determine how much of an object has been downloaded from the Internet. The handler is called only if tellStreamStatus (TRUE) has been called, and the handler has been added to a movie script.
The on streamStatus event handler has the following parameters:
|
|
Displays the Internet address of the data being retrieved. |
|
|
Displays the state of the stream being downloaded. Possible values are |
|
|
Displays the number of bytes retrieved from the network so far. |
|
|
Displays the total number of bytes in the stream, if known. The value may be 0 if the HTTP server does not include the content length in the MIME header. |
|
|
Displays an empty string ("") if the download has not finished; OK ( |
These parameters are automatically filled in by Director with information regarding the progress of the download. The handler is called by Director automatically, and there is no way to control when the next call will be. If information regarding a particular operation is needed, call getStreamStatus().
You can initiate network streams using Lingo commands, by linking media from a URL, or by using an external cast member from a URL. A streamStatus handler will be called with information about all network streams.
Place the streamStatus handler in a movie script.
This handler determines the state of a streamed object and displays the URL of the object:
-- Lingo syntax
on streamStatus URL, state, bytesSoFar, bytesTotal
if state = "Complete" then
put(URL && "download finished")
end if
end streamStatus
// JavaScript syntax
function streamStatus(URL, state, bytesSoFar, bytesTotal) {
if (state == "Complete") {
put(URL + " download finished");
}
}
getStreamStatus(), tellStreamStatus()