|
-
Externally loaded .flv still on screen when stopped
I have successfully loaded an external looping video and stopped it using a keypress function that closes the ns and nc. However a still of the last viewed frame of my video is frozen on the screen and when I go to any other frame in the timeline it covers over the image in the new frame. Also when I go back to the timeline frame with the video a new instance of that video plays but you can still see the image of the old video on the screen. How do I totally remove the video?
Here is my code to call the video: No problems here I think.
---------------------
stop();
//Defining the video to import
var vid:Video = new Video(1280,720);
addChild(vid);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
vid.attachNetStream(ns);
var listener:Object = new Object();
listener.onMetaData = function(evt:Object):void {};
ns.client = listener;
ns.play("video1.flv");
//loop
//function playStatus(event:NetStatusEvent):void
//{
//if (event.info.code == "NetStream.Play.Stop")
//{
//ns.seek(0);
//}
//}
//ns.addEventListener(NetStatusEvent.NET_STATUS, playStatus);
Here is my function to close the video
-------------------
function unloadSwitch(){
if(ns){
ns.close();
nc.close();
}
}
-------------------
Thanks for your help in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|