0

我正在一个场景中制作一个带有视频的项目,但是当我进入下一个场景时,视频不断出现。我怎样才能删除它。

到目前为止,我的代码是:

import flash.net.NetConnection;
import flash.net.NetStream;
import flash.media.Video;
import flash.events.MouseEvent;


var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var videoStream:NetStream = new NetStream(videoConnection);
videoStream.play("short_jump.flv");
var metaListener:Object = new Object();
metaListener.onMetaData = onMetaData;
videoStream.client = metaListener;
var video:Video = new Video();
video.attachNetStream(videoStream);
stage.addChild(video);
video.x=200;

function onMetaData(data:Object):void
{
play_btn.addEventListener(MouseEvent.CLICK, playMovie);
stop_btn.addEventListener(MouseEvent.CLICK, stopMovie);
}

function playMovie(event:MouseEvent):void
{
videoStream.play("short_jump.flv");
}

function stopMovie(event:MouseEvent):void
{
videoStream.pause();
}

谢谢你的支持!

4

1 回答 1

0

video.attachCamera(null) 停止音频和视频,但最后一帧仍保留在视频中。之后您应该只使用 video.visible = false ,这样您就看不到该帧。有一个错误, clear() 没有做它应该做的事情。

于 2013-08-28T09:51:04.800 回答