Hi everybody, thanks for reading this:
On frame 1 of my movie I have a video playing with the code below, it works great, with a scrubber and everything if you want to copy this, but when I go to frame 2 I have a form (that works) but the sound of the video continues playing in the background.
What code should I stop the video to play in any other frame of my movie ?
Thank you.
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(20);
ns.onStatus = function(info){
if(info.code == “NetStream.Buffer.Full”){
bufferClip._visible = false;
}
if(info.code == “NetStream.Buffer.Empty”){
bufferClip._visible = true;
}
if(info.code == “NetStream.Play.Stop”){
ns.seek(0);
}
}
theVideo.attachVideo(ns);
ns.play(“West LA Highlights-Sequence.flv”);
rewindButton.onRelease = function(){
ns.seek(0);
}
playButton.onRelease = function(){
ns.pause();
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns[“onMetaData”] = function (obj) {
duration = obj.duration;
}
function videoStatus(){
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 200;
loader.scrub._x = ns.time / duration * 200;
}
var scrubInterval;
loader.scrub.onPress = function(){
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,194,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function(){
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit(){
ns.seek(Math.floor ((loader.scrub._x / 194)* duration));
}