# Please i need your help, urgent!

**URL:** https://forum.kirupa.com/t/please-i-need-your-help-urgent/162280
**Category:** Uncategorized
**Created:** [September 11, 2005, 7:36pm UTC](https://forum.kirupa.com/t/please-i-need-your-help-urgent/162280 "2005-09-11T19:36:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ladobonline](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@ladobonline](https://forum.kirupa.com/u/ladobonline)
#### Post date: [September 11, 2005, 7:36pm UTC](https://forum.kirupa.com/t/please-i-need-your-help-urgent/162280/1 "2005-09-11T19:36:17Z")

</div>

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-(2_margen))+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!!!
