NetStream class
91
Example
The code in this example starts by creating new NetConnection and NetStream objects. Then
it defines the
onCuePoint
handler for the NetStream object. The handler cycles through each
named property in the
infoObject
object and prints the property's name and value. When it
finds the property named
parameters
, it cycles through each parameter name in the list and
prints the parameter name and value.
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.onCuePoint = function(infoObject:Object)
{
trace("onCuePoint:");
for (var propName:String in infoObject) {
if (propName != "parameters")
{
trace(pr " = " + infoObject[propName]);
}
else
{
trace("parameters =");
if (infoObject.parameters != undefined) {
for (var paramName:String in infoObject.parameters)
{
trace(" " + par ": " +
infoObject.parameters[paramName]);
}
}
else
{
trace("undefined");
}
}
}
trace("---------");
}
ns.play("http://www.helpexamples.com/flash/video/cuepoints.flv");