A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Playing Video's with xml and buttons problem with the bufferclip

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    I'm a brumie, currently in London working for the man
    Posts
    147

    Playing Video's with xml and buttons problem with the bufferclip

    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...

    Code:
    Button.onRelease = function() {
    	
    	CONTENT("video", "2");
    	_root.buffer();  };
    this refers to my video player also in the same actions frame.

    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
    	
    	}
    	}
    };
    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..

    Andy.

  2. #2
    Senior Member
    Join Date
    Nov 2004
    Location
    I'm a brumie, currently in London working for the man
    Posts
    147

    Well it seems that nobody knows..

    no body able to help me out here?

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center