# Newbie about animating a line in actionscript

**URL:** <https://forum.kirupa.com/t/newbie-about-animating-a-line-in-actionscript/123348>\
**Category:** Uncategorized\
**Created:** [September 22, 2004, 9:14pm UTC](https://forum.kirupa.com/t/newbie-about-animating-a-line-in-actionscript/123348 "2004-09-22T21:14:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendersson](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hendersson](https://forum.kirupa.com/u/hendersson)\
**Post date:** [September 22, 2004, 9:14pm UTC](https://forum.kirupa.com/t/newbie-about-animating-a-line-in-actionscript/123348/1 "2004-09-22T21:14:08Z")

</div>

hey! newbie here :h: hmm…i´m trying to start to learn actionscript. so, my idea is to just draw an animated square within i will load an image. but first off i´m trying to draw a straight line from one point to another. my probs is that i would like to control the speed the line will be drawn, first i want it to draw the x-axis quite fast, make a pause and then draw the y-axis and paus. i´m trying to use setInterval(function, speed), but it doesn´t quite work thou :upset: here´s my code:

\_root.createEmptyMovieClip(“mc\_clip”, 0);

function drawLine() {  
//variablar  
x = 0;  
y = 20;

```
mc_clip.onEnterFrame = function() {
	mc_clip.createEmptyMovieClip("newLine", 1);
	with(newLine) {
		lineStyle(1, 0x000000, 100);
		moveTo(200, 20);
		lineTo(x++, y);
	};
};

```

};  
this.drawLine();  
setInterval(drawLine, 1000);
