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.

var connection_nc:NetConnection = new NetConnection();<br />

connection_nc.connect(null);<br />

var stream_ns:NetStream = new NetStream(connection_nc);<br />

my_video.attachVideo(stream_ns);<br />

stream_ns.play("video1.flv");<br />

stream_ns.onStatus = function(infoObject:Object) {<br />

trace("NetStream.onStatus called: ("+getTimer()+" ms)");<br />

for (var prop in infoObject) {<br />

trace("\t"+prop+":\t"+infoObject[prop]);<br />

}<br />

trace("");<br />

};<br />

onCuePoint (NetStream.onCuePoint h<strong>and</strong>ler)<br />

onCuePoint = function(infoObject:Object) {}<br />

Invoked when an embedded cue point is reached while playing an FLV file. You can use this<br />

h<strong>and</strong>ler to trigger actions in your code when the video reaches a specific cue point. This lets<br />

you synchronize other actions in your application with video playback events.<br />

Two types of cue points can be embedded in an FLV file.<br />

A “navigation” cue point specifies a keyframe within the FLV file <strong>and</strong> the cue point's time<br />

property corresponds to that exact keyframe. Navigation cue points are often used as<br />

bookmarks or entry points to let users navigate through the video file.<br />

An “event” cue point is specified by time, whether or not that time corresponds to a specific<br />

keyframe. An event cue point usually represents a time in the video when something happens<br />

that could be used to trigger other application events.<br />

The onCuePoint event h<strong>and</strong>ler receives an object with these properties:<br />

Property Description<br />

name The name given to the cue point when it was embedded in the FLV<br />

file.<br />

time The time in seconds at which the cue point occurred in the video file<br />

during playback.<br />

type The type of cue point that was reached, either "navigation" or<br />

"event".<br />

parameters A associative array of name/value pair strings specified for this cue<br />

point. Any valid string can be used for the parameter name or value.<br />

You can define cue points in an FLV file when you first encode the file, or when you import a<br />

video clip in the Flash Authoring tool by using the Video Import wizard.<br />

506 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!