# Targeting Problem?

**URL:** <https://forum.kirupa.com/t/targeting-problem/98317>\
**Category:** Uncategorized\
**Created:** [January 6, 2004, 12:13am UTC](https://forum.kirupa.com/t/targeting-problem/98317 "2004-01-06T00:13:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yeldarb](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yeldarb](https://forum.kirupa.com/u/Yeldarb)\
**Post date:** [January 6, 2004, 12:13am UTC](https://forum.kirupa.com/t/targeting-problem/98317/1 "2004-01-06T00:13:41Z")

</div>

I’m messing around w/ drawing API, and this script worked a second ago, then I made it draw in a created movieClip and now it doesn’t work…? Am I missing something here…?

```auto
theWidth = 88;
theHeight = 31;

setInterval(drawIt, 100);

function drawIt() {
	createEmptyMovieClip(shapes, 0);
	shapes.lineStyle(3, 000000, 100);
	generateRandoms();
	startingX = randomX;
	startingY = randomY;
	shapes.moveTo(randomX, randomY);
	for (i=0; i<5; i++) {
		generateRandoms();
		shapes.lineTo(randomX, randomY);
	}
	shapes.lineTo(startingX, startingY);
}

function generateRandoms() {
	randomX = random(theWidth+1);
	randomY = random(theHeight+1);
}

```

thanks  
:thumb:

EDIT: Hmmm, in hindsight, I think I should have put this in the actionScript forum, oh well…
