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

Create successful ePaper yourself

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

The onMetaData event h<strong>and</strong>ler also retrieves information about the cue points in a video file.<br />

However the onMetaData event h<strong>and</strong>ler gets information about all of the cue points before the<br />

video begins playing. The onCuePoint event h<strong>and</strong>ler receives information about a single cue<br />

point at the time specified for that cue point during playback.<br />

Generally if you want your code to respond to a specific cue point at the time it occurs you<br />

should use the onCuePoint event h<strong>and</strong>ler to trigger some action in your code.<br />

You can use the list of cue points provided to the onMetaData() event h<strong>and</strong>ler to let your user<br />

start playing the video at predefined points along the video stream. Pass the value of the cue<br />

point's time property to the NetStream.seek() method to play the video from that cue point.<br />

Availability<br />

ActionScript 1.0; Flash Player 8<br />

Parameters<br />

infoObject:Object - An object containing the name, time, type, <strong>and</strong> parameters for the cue<br />

point.<br />

Example<br />

The code in this example starts by creating new NetConnection <strong>and</strong> NetStream objects. Then<br />

it defines the onCuePoint() h<strong>and</strong>ler for the NetStream object. The h<strong>and</strong>ler cycles through<br />

each named property in the infoObject object <strong>and</strong> prints the property's name <strong>and</strong> value.<br />

When it finds the property named parameters it cycles through each parameter name in the<br />

list <strong>and</strong> prints the parameter name <strong>and</strong> value.<br />

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

nc.connect(null);<br />

var ns:NetStream = new NetStream(nc);<br />

ns.onCuePoint = function(infoObject:Object)<br />

{<br />

trace("onCuePoint:");<br />

for (var propName:String in infoObject) {<br />

if (propName != "parameters")<br />

{<br />

trace(propName + " = " + infoObject[propName]);<br />

}<br />

else<br />

{<br />

trace("parameters =");<br />

if (infoObject.parameters != undefined) {<br />

for (var paramName:String in infoObject.parameters)<br />

{<br />

NetStream 507

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

Saved successfully!

Ooh no, something went wrong!