03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Seeks the keyframe closest to the specified number of seconds from the beginning of the<br />

stream. The stream resumes playing when it reaches the specified location in the stream.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7 - Note: This method is also supported in Flash<br />

Player 6 when used with Flash Media Server. For more information, see the Flash Media<br />

Server documentation.<br />

Parameters<br />

offset:Number - The approximate time value, in seconds, to move to in an FLV file. The<br />

playhead moves to the keyframe of the video that's closest to offset.<br />

■ To return to the beginning of the stream, pass 0 for 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 at 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 a video seeks will differ depending on the frames per second<br />

setting at which it was exported. Therefore, if the same video is exported at 6 fps <strong>and</strong> 30 fps, it<br />

will seek to two different locations if you use, for example, my_ns.seek(15) for both video<br />

objects.<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 backwards 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 />

See also<br />

play (NetStream.play method), time (NetStream.time property)<br />

996 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!