03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NOTE: This method is also supported in Flash Player 6 when used with Flash Media<br />

Server. For more information, see the Flash Media Server documentation.<br />

Parameters<br />

offset:Number - The approximate time value, in seconds, by which to move the playhead in<br />

an FLV file. The playhead moves to the keyframe of the video that's closest to the value<br />

specified by offset.<br />

■ To return to the beginning of the stream, pass 0 to offset.<br />

■ To seek forward from the beginning of the stream, pass the number of seconds you want<br />

to advance. For example, to position the playhead 15 seconds from the beginning, use<br />

my_ns.seek(15).<br />

■ To seek relative to the current position, pass my_ns.time + n or my_ns.time - n to seek<br />

n seconds forward or backward, respectively, from the current position. For example, to<br />

rewind 20 seconds from the current position, use my_ns.seek(my_ns.time - 20).<br />

The precise location to which the playhead moves differs according to the frames-per-second<br />

(fps) setting at which the video was exported. For example, suppose you have two video<br />

objects that represent the same video, one exported at 6 fps <strong>and</strong> the other at 30 fps. If you<br />

then use my_ns.seek(15) for both objects, the playhead moves to two different locations.<br />

Example<br />

The following example illustrates some ways to use the NetStream.seek() comm<strong>and</strong>. You<br />

can return to the beginning of the stream, move to a location 30 seconds from the beginning<br />

of the stream, <strong>and</strong> move backward three minutes from the current location:<br />

// Return to the beginning of the stream<br />

my_ns.seek(0);<br />

// Move to a location 30 seconds from the beginning of the stream<br />

my_ns.seek(30);<br />

// Move backwards three minutes from current location<br />

my_ns.seek(my_ns.time - 180);<br />

setBufferTime (NetStream.setBufferTime) method<br />

public setBufferTime(bufferTime:Number) : Void<br />

Specifies how long to buffer messages before starting to display the stream. For example, if<br />

you want to make sure that the first 15 seconds of the stream play without interruption, set<br />

bufferTime to 15; Flash begins playing the stream only after 15 seconds of data are buffered.<br />

NetStream 513

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!