Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 Benutzerhandbuch

Seite von 156
NetStream class
95
NetStream.onStatus
Availability
Flash Player 6.
Flash Communication Server MX 1.0.
Usage
public onStatus = function(infoObject:Object) {}
Parameters
infoObject
  A parameter defined according to the status or error message. For more 
information about this parameter, see 
.
Returns
Nothing.
Description
Event handler; invoked every time a status change or error is posted for the NetStream object. 
If you want to respond to this event handler, you must create a function to process the 
information object sent by the server. For more information, see 
.
In addition to this 
NetStream.onStatus
 handler, Flash also provides a super function called 
System.onStatus
. If 
NetStream.onStatus
 is invoked for a particular object and there is no 
function assigned to respond to it, Flash processes a function assigned to 
System.onStatus
 if 
it exists.
Example
The following example displays data about the stream in the Output panel:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);
stream_ns.play("video1.flv");
stream_ns.onStatus = function(infoObject:Object) {
        trace("NetStream.onStatus called: ("+getTimer()+" ms)");
        for (var prop in infoObject) {
            trace("\t"+prop+":\t"+infoObject[prop]);
        }
        trace("");
};