我有问题。 我想在netstream中添加一个onClick方法。 我读到你需要打开netstream movieclip。 我这样做了,问题是因为视频没有显示
private var nc:NetConnection;
private var ns:NetStream;
private var video:Video;
private var adSoundTransform:SoundTransform;
private var mc_flv:MovieClip;
public function FakeAd(lineColor:Number, fillColor:Number, label:String)
{
function asyncErrorHandler(event:AsyncErrorEvent):void
{
}
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, this.asyncErrorHandler);
ns.play("http://www.helpexamples.com/flash/video/cuepoints.flv");
video = new Video(640,360);
video.attachNetStream(ns);
video.smoothing = true;
//addChild(video);
mc_flv.addChild(video);
//ns.resume();
//video.x = stage.stageWidth/2;
//video.y = stage.stageHeight/2;
mc_flv.addEventListener(MouseEvent.CLICK,onClick);
function onClick(e:MouseEvent):void
{
navigateToURL(new URLRequest("http://Google.com"));
}