Using a bit of xml to bring in my videos oh the joy..
well they are in an array.. that bit was quite easy.. thanks to experience.. but my niggly little problem is with the buffer clip.. i'm using buttons to control which videos are seen at and one point..
therefore when the button is selected.
it goes and finds the right source file from the xml and loads it into the ns with this piece of code.
Button Code...
this refers to my video player also in the same actions frame.Code:Button.onRelease = function() { CONTENT("video", "2"); _root.buffer(); };
well thankyou for reading that long bit of coding.. any help would be most grateful.. i'm sure i'm 98% there just that last 2% is killing me..Code://THIS BIT IS OUTSIDE OF THE FUNCTION.. AND FOR SOME STRANGE REASON DOESN'T WORK WHEN INSIDE THE FUNCTION ??? function playvideo() { _root.videoholder_mc.attachVideo(_root.my_ns); _root.my_ns.setBufferTime(30); //_root.playmovie.. is the flv file.. source from an xml document _root.my_ns.play(_root.playMovie); trace("video..stream..source..."+_root.playMovie); // this traces it's path.. all ok.. var videoInterval = setInterval(videoStatus, 100); var amountLoaded:Number; var duration:Number; _root.my_ns["onMetaData"] = function (obj) { duration = obj.duration; }; function videoStatus() { amountLoaded = _root.my_ns.bytesLoaded/_root.my_ns.bytesTotal; // This is my loading bar.. this also doesn't seem to work _root.videoholder_mc.loader.loadbar._width = amountLoaded*400; _root.videoholder_mc.loader.loadbar._width = amountLoaded*400; // On the other hand this does.??? _root.videoholder_mc.loader.progressbar._width = _root.my_ns.time/duration*400; _root.videoholder.loader.progressbar._width = _root.my_ns.time/duration*400; } _root.my_ns.onStatus = function(info) { //THIS IS WHERE IT ALL GOES WRONG BUFFER CLIP WILL SHOW FOR FIRST VIDEO THE INTRO BUT NOT FOR ANY OTHERS... CONFUSED I AM. if (info.code == "NetStream.Buffer.Full") { _root.videoholder_mc.bufferClip._visible = false; } if (info.code == "NetStream.Buffer.Empty") { _root.videoholder_mc.bufferClip._visible = true; } if (info.code == "NetStream.Play.Stop") { //STILL NOT SURE WHAT I'M PUTTING HERE YET } } };
Andy.




Reply With Quote