Targeting Problem?

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…?

theWidth = 88;
theHeight = 31;

setInterval(drawIt, 100);

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

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


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