基本上我会试着总结一下。我有一堆潜在的随机字符串 recvStream.play("randomstring");
然后我有一个计时器每 5 秒检查一次运行事件侦听器的函数:
recvStream.addEventListener(NetStatusEvent.NET_STATUS,
netConnectionHandler);
然后我在一个 switch 语句中思考,我可以使用它来检查它是否是活动流,或者让它搜索另一个应该处于活动状态的流,或者停止计时器并让它播放。
// i was thinking this would verify it's playing and then that's it
case "NetStream.Play.Start" :
trace("ITS PLAYING YOU SHOULD SEE SOMETHING");
timer.stop();
break;
// i was thinking i could use this to see if the string is nothing then the timer would run again
case "NetStream.Buffer.Empty" :
trace("THE BUFFER IS EMPTY KEEP LOOKING");
//code to look again
break;
//I also tried NetStream.Play.StreamNotFound instead of NetStream.Buffer.Empty didn't work either
但它真的不是那样工作的。我应该使用其他东西来代替 NetStream.Buffer.Empty 吗?还是其他什么都在一起?
我在 Flash CS5 中使用 Actionscript 3,我正在使用 Cirrus RTMFP http://labs.adobe.com/technologies/cirrus/