Closing Drawing API shape

I’ve been making changes to an Ivan Dembicki “elastic line” sample file. I’d like to close off the shape with a curved line so that the shape doesn’t have a hard edge to it. Right now the shape fill closes off the shape (the shape itself isn’t closed). I’ve tried various things but failed miserably. Anyone know how to turn this into a closed, rounded shape? I’ll attach my file but this is what Ivan’s drawing API code looks like:

p.onEnterFrame = function() {
    //this.lineStyle(3, 0xFF0000, 100);
    this.lineStyle(1, 0x4827CF);
    for (var i = 1; i<this.arrMC.length-1; i++) {
    var e, s = this.arrMC[0];
    this.moveTo(s._x, s._y);
    for (var i = 1; i<this.arrMC.length; i++) {
        s = this.arrMC[i-1];
        e = this.arrMC*;
        var mx = (s._x+e._x)/2;
        var my = (s._y+e._y)/2;
        this.curveTo(s._x, s._y, mx, my);
    this.lineTo(e._x, e._y);

I’m working in Flash MX 2004. Thanks for the help.