我以前有这个工作,但已经停止工作了,我不记得更改任何我收到以下错误
ArgumentError: Error #2126: NetConnection object must be connected.
at flash.net::NetStream/ctor()
at flash.net::NetStream()
at Classes::AccessCamera/UICompleteHandler()
Cannot display source code at this location.
Debug session terminated.
这是我播放视频的代码:
var conn:NetConnection = new NetConnection();
var stream:NetStream = new NetStream(conn);
var media:MediaPromise = event.data;
trace(media.file.url + " - " + media.relativePath + " - " +media.mediaType);
parent.addChild(video);
conn.connect(null);
//attach a stream to the video-object
video.attachNetStream(stream);
stream.client = new MobileClient();
//play the stream
stream.play(media.file.url);
我被困在这方面,无法弄清楚任何帮助将不胜感激。
您应该在将其传递给NetStream
实例之前连接NetConnection
实例。
请参阅http://help.adobe.com/en_us/flashplatform/reference/cretionscript/3/flash/net/netstream.html有关更多信息。