# Making line draw itself

**URL:** https://forum.kirupa.com/t/making-line-draw-itself/10621
**Category:** flash
**Created:** [January 4, 2003, 8:52am UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621 "2003-01-04T08:52:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ophion](https://avatars.discourse-cdn.com/v4/letter/o/7ea924/32.png) [@Ophion](https://forum.kirupa.com/u/Ophion)
#### Post date: [January 4, 2003, 8:52am UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/1 "2003-01-04T08:52:40Z")

</div>

I’ve hit a wall. I need to make a line look like it’s drawing itself, as if an invisible hand is drawing on the screen. For some reason, though, I can’t figure out or find how to do this.

Could anybody link me to a tutorial or tell me how I might do this? I really appreciate any input in advance. 😏

-Jacob

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 4, 2003, 10:39am UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/2 "2003-01-04T10:39:11Z")

</div>

Take a look at the drawing board tutorial on this site, and maybe also the thinggy in the AS tricks section about the drawing API.

Cheers.  
pom :hangover:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 4, 2003, 11:59am UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/3 "2003-01-04T11:59:52Z")

</div>

Thanks, but the drawing API tutorial doesn’t show me how to make it look like the drawing is being done as you watch it…it just makes the shapes/lines.

The drawing forum covers artwork mostly too, which is off-topic. :-\

Thanks, though, for the reply! I learned some new stuff from the API tut.

-J

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 4, 2003, 12:14pm UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/4 "2003-01-04T12:14:35Z")

</div>

Put your points in a array and then draw onEnterFrame. Something like this:

```auto
// Array of points
myPoints=[];
// Fill the array with random points
for (var i=0;i < 50;i++){
	myPoints.push({x:Math.random()*Stage.width,y:Math.random()*Stage.height});
}
// handler that draws
this.lineStyle(1,0,100);
this.moveTo(myPoints[0].x,myPoints[0].y);
this.onEnterFrame=function(){
	++j;
	if (j < myPoints.length){
		this.lineTo(myPoints[j].x,myPoints[j].y);
	}
	else delete this.onEnterFrame
}

```

pom :hangover:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 4, 2003, 1:15pm UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/5 "2003-01-04T13:15:51Z")

</div>

check this out and let me know if this is what you want to do  
[http://www.expocaribbean.com/uwantmore/bmv\_menu.swf](http://www.expocaribbean.com/uwantmore/bmv_menu.swf)  
if so you just make shape tweens and put a alpha on the first frame of each shape tween

Grim

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 4, 2003, 1:22pm UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/6 "2003-01-04T13:22:54Z")

</div>

> \*Originally posted by grimdeath \*  
> \*\*check this out and let me know if this is what you want to do  
> [http://www.expocaribbean.com/uwantmore/bmv\_menu.swf](http://www.expocaribbean.com/uwantmore/bmv_menu.swf)  
> if so you just make shape tweens and put a alpha on the first frame of each shape tween

Yeah, that’s what I had in mind. The shape tweens work like I need them too. Thanks grimdeath and ilyaslamasse for your help.

-J

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 4, 2003, 1:33pm UTC](https://forum.kirupa.com/t/making-line-draw-itself/10621/7 "2003-01-04T13:33:04Z")

</div>

np glad i could help 😃

Grim
