Flash Player 7.
Note: This handler is also supported in Flash Player 6 when used with Flash Communication Server. For more information, see the Flash Communication Server documentation.
my_ns.onStatus = function(infoObject:Object): Void{ // Your code here }
infoObject A parameter defined according to the status or error message. For more information about this parameter, see "Description," below.
Nothing.
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.
The information object has a code property containing a string that describes the result of the onStatus handler, and a level property containing a string that is either status or error.
In addition to this onStatus handler, Flash also provides a "super" function called System.onStatus. If 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.
The following events notify you when certain NetStream activities occur.
| Code property | Level property | Meaning |
|---|---|---|
NetStream.Buffer.Empty |
status |
Data is not being received quickly enough to fill the buffer. Data flow will be interrupted until the buffer refills, at which time a |
NetStream.Buffer.Full |
status |
The buffer is full and the stream will begin playing. |
NetStream.Play.Start |
status |
Playback has started. |
NetStream.Play.Stop |
status |
Playback has stopped. |
NetStream.Play.StreamNotFound |
error |
The FLV passed to the |
If you consistently see errors regarding buffer, you should try changing the buffer using the NetStream.setBufferTime() method.
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("");
};
System.onStatus, NetStream.setBufferTime()
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001596.html
Comments
recoveredfromflashMX2004 said on Aug 4, 2004 at 3:42 PM : FredzCode said on Aug 20, 2004 at 1:59 PM : Squee-D said on Sep 1, 2004 at 3:48 PM : robant_robz said on Oct 7, 2004 at 11:44 AM : kjasonwest said on Oct 28, 2004 at 12:37 PM : kjasonwest said on Oct 28, 2004 at 12:56 PM : henry_ilabs said on Dec 11, 2004 at 11:27 AM : DigitalGroover said on Dec 17, 2004 at 9:14 AM : kevin_murray said on Dec 31, 2004 at 11:26 AM : james_b said on Jan 1, 2005 at 12:28 PM : No screen name said on Jan 13, 2005 at 5:43 PM : nintendo-n8dawg said on Jan 13, 2005 at 6:17 PM : Flash-Ripper.com said on Jan 24, 2005 at 8:58 AM : petetschudy said on Jan 25, 2005 at 7:20 AM : cheegs said on Jan 26, 2005 at 12:50 PM : obspaceman said on Mar 10, 2005 at 6:38 PM : obspaceman said on Mar 10, 2005 at 6:41 PM : dodgetigger said on Jun 9, 2005 at 2:07 AM : fuad_all said on Jul 1, 2005 at 4:26 AM : fuad_all said on Jul 1, 2005 at 8:24 AM :