Hi i am currently trying to design a site and i havee an empty movieclip on the stage that other movieclips are loaded into and when the video section is loaded and the user plays the videoit works fine but hwen they click the home button and the movie section is removed from the empty movieclip the video file can still be heard and must still be playing, however when the user goes to another section i want the site to stop playing the video file. My video code is below that is contained within the loaded movie section not the main SWF:
[AS]var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = this;
ns.play(“Videos/R8 Vid.flv”);
ns.pause();
function onMetaData(info:Object):void
// this function just checks to make sure the meta data was recieved
{
//trace(“meta data sent”);
}
var vid:Video = new Video();// this creates a new variable to store a new instance of the video in.
vid.attachNetStream(ns);//The attaches the video file to the video playback object
addChild(vid);//This adds the video to the stage
vid.x = 29;//This controls the x location of the video
vid.y = 23;//This controls the y location of the video
vid.width = 270;//This controls the width of the video
vid.height = 195;//This controls the height of the video
playBttn.addEventListener(MouseEvent.CLICK, playClick);
stopBttn.addEventListener(MouseEvent.CLICK, stopClick);
pauseBttn.addEventListener(MouseEvent.CLICK, pauseClick);
volUpBttn.addEventListener(MouseEvent.CLICK, volUpClick);
volDownBttn.addEventListener(MouseEvent.CLICK, volDownClick);
//muteBttn.addEventListener(MouseEvent.CLICK, muteClick);
var st:SoundTransform=new SoundTransform();
function playClick(e:MouseEvent):void
{
ns.resume();
}
function stopClick(e:MouseEvent):void
{
ns.pause();
ns.seek(0);
}
function pauseClick(e:MouseEvent):void
{
ns.togglePause();
}
function volUpClick(e:MouseEvent):void
{
if(st.volume < 1)
{
st.volume = st.volume + 0.1;
ns.soundTransform=st;
}
}
function volDownClick(e:MouseEvent):void
{
if(st.volume > 0)
{
st.volume = st.volume - 0.1;
ns.soundTransform=st;
}
}
[/AS]