I can’t seem to get a stop/ button to work… If anyone could lend a helping hand that would be great.
Here’s my code so far.
var myNetConn:NetConnection;
var myNetStream:NetStream;
var videoLV:LoadVars;
this.videoContainer._visible = false;
//-------------<VideoActivate>-----------------//
function videoActivate() {
this.videoContainer._visible = true;
//REPLACE THE .FLV HERE!!!!!!!
myNetStream.play("chasing_cars_video.flv");
this.vidProgBar.onEnterFrame = function() {
var progPos:Number = Math.round((myNetStream.time/videoLV.totalTime) * 100);
this.vidProgBar.vidProg._x = progPos;
var vidD1Percent:Number = Math.round((myNetStream.bytesLoaded/myNetstream.bytesTotal)*100);
this.vidProgBar.progMaskContainer.progMask._width = vidD1Percent + 10;
}
}
//-------------</VideoActivate>-----------------//
this.pause.onRelease = function () {
myNetStream.pause();
}
this.play.onRollOver = function () {
}
this.play.onRollOut = function () {
}
//back to scene 1//
this.play.onRelease = function () {
this.enabled = false;
initializeVideo();
videoActivate();
//play2.gotoAndPlay(2);
}
//-------------<Video>-----------------//
function initializeVideo() {
myNetConn = new NetConnection();
myNetConn.connect(null);
myNetStream = new NetStream(myNetConn);
this.videoContainer.myVideo.attachVideo(myNetStream);
myNetStream.setBufferTime(5);
myNetStream.onStatus = function(info) {
if (info.code == "NetStream.Play.Stop" && info.level == "status") {
this.togglePlay.gotoAndStop(2);
myNetStream.seek(0);
myNetStream.pause(true);
}
}
videoLV = new LoadVars();
videoLV.onLoad = function (success) {
if (success) {
videoActivate();
}
//videoLV.load("video_info.txt");
}
}
//-------------</Video>-----------------//
//-------------<ourVideoOption>-----------------//
//-------------</ourVideoOption>-----------------//
//-------------<VideoDeactivate>-----------------//
function videoDeactivate() {
this.videoContainer._visible = false;
delete _root.vidProgBar.onEnterFrame;
}
//-------------</VideoDeactivate>-----------------//
//-------------<cancelVideo>-----------------//
//close//
this.stop.onRollOver = function () {
}
this.stop.onRollOut = function () {
}
//back to scene 1//
this.stop.onRelease = function () {
//togglePlay.gotoAndStop(1);
myNetStream.close();
myNetStream.seek(0);
videoContainer.myVideo.clear();
delete videoContainer.myVideo.onEnterFrame;
videoDeactivate();
videoActivate();