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

Page of 156
94
Client-Side ActionScript Language Reference
NetStream.onPlayStatus
Availability
Flash Player 6.
Flash Media Server 2. 
Usage
public onPlayStatus = function(infoObject:Object) {}
Parameters
infoObject
  An object containing an error or status message. For more information about 
this parameter, see 
Returns
Nothing.
Description
Event handler; invoked when a NetStream object has completely played a stream. The 
information object gives extra information when a NetStream object has switched from one 
stream to another stream in a playlist (
NetStream.Play.Switch
) or when a NetStream object 
has played to the end (
NetStream.Play.Complete
). 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 
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"); stream_ns.onPlayStatus = 
function(infoObject:Object) {
trace("NetStream.onPlayStatus called: ("+getTimer()+" ms)");
for (var prop in infoObject) {
trace("\t"+prop+":\t"+infoObject[prop]);
}
trace("");
};