-
[RESOLVED] video won't stop
I have a website that plays video1 when it opens. When you navigate to next page the video stops. One of the buttons on the second page plays video2. The problem is that video 2 won't stop using the same command that made video1 stop.
Thanks to anyone who can help me out.
D
here is the code for the home page:
var vid:Video = new Video();
var nc:NetConnection = new NetConnection();
nc.connect(null);
var netStream:NetStream = new NetStream(nc);
netStream.close();
vid.visible=false;
netStream.addEventListener(NetStatusEvent.NET_STAT US, ns_onPlayStatus);
addChild(vid);
vid.attachNetStream(netStream);
netStream.bufferTime=3;
netStream.play("video1.flv");
vid.visible=true;
vid.width=665;
vid.height=500;
vid.x=40;
vid.y=180;
here is the code for page 2:
netStream.close();
vid.visible=false;
bInside.addEventListener(MouseEvent.CLICK, video2);
function video2(event:MouseEvent):void {
mcRates.stop();
mcActivities.stop();
mcMap.stop();
mcRates.visible=false;
mcActivities.visible=false;
mcMap.visible=false;
nc.connect(null);
netStream.play("video2.flv");
vid.visible=true;
vid.width=480;
vid.height=360;
vid.x=250;
vid.y=240;
}
bRates.addEventListener(MouseEvent.CLICK, rates);
function rates(event:MouseEvent):void {
mcRates.play();
mcActivities.stop();
mcMap.stop();
netStream.close();
vid.visible=false;
mcRates.visible=true;
mcActivities.visible=false;
mcMap.visible=false;
}
-
Senior Member
I think the reason is that when you go back from video2 to video1 you create the video object, the Netconnection and Netstream newly again. One possibility could be when you use frames (which is bad when using AS) that you load separate movies containing the videos into the same loader.
- The right of the People to create Flash movies shall not be infringed. -
-
I think you may be right. I fixed the problem by putting the stop command in the home button.
Tags for this Thread
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
|