Please i need your help, urgent!

Hi!
I’m beginning with AS and it’s very difficult to do
what I want…
I’d like to generate a random line with lots of
points and curves (and loops) but the beginning and
ending points should remain in the same places (like a
snake). When dragging the ending point, the line should move with
“elastic movement” until it is released, but the
beginning point always staying in the same place.
Preferably, I’d like the line to look
like if someone is drawing it and not all in a once.
Please help me!!

Here is my code:
thanks!!!

totalPuntos = 5;
alto = 380;
ancho = 100;
margen = 10;
pix = 200;
piy = 0;
pfx = 200;
pfy = 400;

for (i=1; i<=totalPuntos; i++) {
this[“p”+i+“x”] = random(ancho-(2margen))+margen;
this[“p”+i+“y”] = random(alto-(2
margen))+margen;
}

this.createEmptyMovieClip(“lienzo”, 0);

this.moveTo(pix, piy);

for (i=1; i<=totalPuntos; i++) {
this.lineStyle(0,0x999999,100);
this.curveTo([“p”+i+“x”],[“p”+i+“y”],this[“p”+i+“x”],
this[“p”+i+“y”]);
}

this.curveTo([“p”+i+“x”],[“p”+i+“y”],pfx, pfy);

THANK YOU!!!