I have a function that I want to use to draw multiple lines onto/into the "line" MC, but I keep overwriting previous lines. Usually when attaching multiple MC's from the library I do something like this:
Code:
attachMovie("Ball", "ball"+balls.length, getNextHighestDepth(), etc..
So I thought I could do something similar with createEmptyMC:
Code:
line.createEmptyMovieClip("puddle"+puddles.length, getNextHighestDepth());
But when I do this like the latter example nothing shows up on stage. Without adding the "
+puddles.length" it shows up, but I seem to overwrite the last line when adding a new. Below is the function I'm using, which seems to work ok except for the fact that only the last call will show. The drip is just a visual touch I add to each line.
Any idea what I'm doing wrong?
Code:
function draws(from, to, color)
{
line.createEmptyMovieClip("puddle", this.getNextHighestDepth());
line.puddle.lineStyle(20, color, 100);
line.puddle.moveTo(from, bottom);
line.puddle.lineTo(to, bottom);
line.puddle.color = color;
line.puddle.attachMovie("drip", "drip", getNextHighestDepth(), {_x:to, _y:bottom});
new Color(line.puddle.drip).setRGB(color);
puddles.unshift(line.puddle);
}