View comments | RSS feed

NetStream.onStatus

Availability

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 NetStream information objects.

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 Client-Side Information Objects.

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("");
};

Comments


MotionMaker said on Dec 12, 2006 at 11:36 AM :
I believe
stream_ns.play("video1.flv");
should be
stream_ns.play("video1");
breez11 said on Aug 15, 2007 at 10:43 AM :
only with use of fms. There is a couple ways you can tell this example is using the progressive download method. One is on this line connection_nc.connect(null).

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000586.html