Flash Lite 2.x and 3.0 ActionScript Language Reference

NetStream

Creates a stream that can be used for playing FLV files through the specified NetConnection object.

Local file URLs are also supported by simply replacing "http:" with "file:" For example:

NetStream.play("http://somefile.flv");
NetStream.play("file://somefile.flv");

NOTE

 

Standard security restrictions apply. For example a remote SWF file cannot access absolute file:// URLs in the form of "file://C:/somefile.flv".

NetStream Class methods

Method

Description

close()

close():void

Stops playing all data on the stream, sets the time property to 0, and makes the stream available for another use.

pause()

pause():void

Pauses playback of a video stream.

play()

play(... arguments):void

Begins playback of external audio or a video (FLV) file.

seek()

Seeks the keyframe closest to the specified number of seconds from the beginning of the stream.

setBufferTime()

Specifies how long to buffer messages before starting to display.

NetStream Class properties

Properties

Description

bufferLength

The number of seconds of data currently in the buffer.

bufferTime

The number of seconds assigned to the buffer by setBufferTime().

bytesLoaded

The number of bytes of data that have been loaded into the player.

bytesTotal

The total size in bytes of the file being loaded into the player.

currentFPS

The number of frames per second being displayed.

time

The position of the playhead, in seconds.

NetStream Class events

Event

Description

onStatus

Invoked when a status change or error is posted for the NetStream object.

onCuePoint

Invoked when an embedded cue point is reached during the playing of an FLV.

OnMetaData

Invoked when Flash Player receives descriptive information embedded in the FLV.