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

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

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

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<br />

point.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Parameters<br />

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

cue 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 />

trace(" " + paramName + ": " +<br />

infoObject.parameters[paramName]);<br />

}<br />

}<br />

else<br />

{<br />

trace("undefined");<br />

}<br />

NetStream 989

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

Saved successfully!

Ooh no, something went wrong!