FLV Help needed: combining onStatus and onMetaData code

i have two snippets of AS2 code that don’t get along. one piece lets a set of videos play sequentially (see snippet A below), and the other piece helps run a custom video player (snippet B). both sets have onStatus and onMetaData information that i somehow need to rewrite, restack, or collate. any help would be very much appreciated, thanks!!

SNIPPET A (sequential playback)

ns.onMetaData = function(evt:Object):Void {
  duration = evt.duration;
  ready = true;
};

ns.onStatus = function(evt:Object):Void {
  if (ready && this.time > 0 && this.time >= (duration - 0.1)) { //changed from 0.5
    ready = false;
    currentVideo++;
    if (currentVideo < videos.length) {
      ns.play(videos[currentVideo]);
    } else {
      delete this.onStatus;
    }
  }
}


SNIPPET B (custom player control)

ns.onStatus = function(info) {
    if(info.code == "NetStream.Play.Start") {
        progressBar.onEnterFrame = videoUpdate;
    }
    if(info.code == "NetStream.Play.Stop") {
        delete progressBar.onEnterFrame;
    }
}

ns.onMetaData = function(info) {
    ns.duration = info.duration;
}