User Guide
974 ActionScript classes
NetStream constructor
public NetStream(connection:NetConnection)
Creates a stream that can be used for playing FLV files through the specified NetConnection
object.
Availability: ActionScript 1.0; Flash Player 7 - Note: This class is also supported in Flash
Player 6 when used with Flash Communication Server. For more information, see the Flash
Communication Server documentation.
Parameters
connection:NetConnection - A NetConnection object.
Example
The following code first constructs a new NetConnection object,
connection_nc, and uses it
to construct a new NetStream object called
stream_ns. Select New Video from the Library
options menu to create a video object instance, and give it an instance name
my_video.
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");
See also
NetConnection, attachVideo (Video.attachVideo method)
onCuePoint (NetStream.onCuePoint handler)
onCuePoint = function(infoObject:Object) {}
Invoked when an embedded cue point is reached while playing an FLV file. You can use this
handler to trigger actions in your code when the video reaches a specific cue point. This lets
you synchronize other actions in your application with video playback events.
There are two types of cue points that can be embedded in an FLV file.
■ A "navigation" cue point specifies a keyframe within the FLV file and the cue point's time
property corresponds to that exact keyframe. Navigation cue points are often used as
bookmarks or entry points to let users navigate through the video file.
■ An "event" cue point is specified by time, whether or not that time corresponds to a
specific keyframe. An event cue point usually represents a time in the video when
something happens that could be used to trigger other application events.