clear video before going to another frame
Hello im doing a presentation that has some videos on it. To watch the
videos i have made some buttons and i found a code to bring the external
videos to stage. The problem is that when i go to the next frame the last
video stays there. This is the code i have to set the videos on the stage:
miguel_btn.addEventListener(MouseEvent.CLICK,video_miguel);
function video_miguel(event:MouseEvent):void
{
var conexion10:NetConnection= new NetConnection();
conexion10.connect(null);
var display10:NetStream= new NetStream(conexion10);
display10.play("Miguel_1.flv");
var video10:Video=new Video();
video10.attachNetStream(display10);
video10.x= 150;
video10.y= 250;
stage.addChild(video10);
display10.addEventListener(AsyncErrorEvent.ASYNC_ERROR,nomostrar10);
function nomostrar10(event:AsyncErrorEvent):void
{
}
}
and i was trying to removing them with :
if (event.keyCode == Keyboard.RIGHT)
{
nextFrame();
video10.clear();
}
but i am a new at as3 and it does not work. Thanks.
No comments:
Post a Comment