Flex/as3:如何从 NetStream 对象获取名称?
在类型为 < 的 Flex NetStatusEvent 中code>NetGroup.MulticastStream.PublishNotify,您可以在 e.info.name 中获取流的字符串名称,
该名称是发布者在 .publish ("") 方法中指定的名称。
但在 NetStream.Connect.Success
类型的 NetStatusEvent 中,没有这样的属性。相反,整个 NetStream 对象是可通过 e.info.stream
获得
你到底如何从 NetStream 对象中获取像名称这样基本的东西? e.info.stream.name
不存在。
我一定忽略了一些非常简单的事情。
In a Flex NetStatusEvent of type NetGroup.MulticastStream.PublishNotify
, you get the String name of the stream in e.info.name
The name is what the publisher specified in the .publish ("") method.
But in a NetStatusEvent of type NetStream.Connect.Success
, there is no such property. Instead, the whole NetStream object is available through e.info.stream
How the heck to you get something as basic as the name from the NetStream object? e.info.stream.name
does not exist.
I must be overlooking something very simple.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,正如所料,解决方案非常简单。 NetStream 初始化后,
NetStream.Connect.Success
事件就会触发。它可用于播放任何已发布的流 - 换句话说,此时尚未为其分配 .publish'ed 名称。Yes, as expected, the solution is very simple. The
NetStream.Connect.Success
event fires as soon as the NetStream is initialized. It can be used to .play any published stream - in other words, it has not been assigned a .publish'ed name at this point.