Having trouble with this piece of code (arrays and addChild)
Quote:
var myShapes:Array = [tl, tr, bl, br];
trace(myShapes);
var long:uint = myShapes.length;
for (var i:uint = 0; i < long; i++)
{
addChild();
this.x = Math.random() * stage.stageWidth;
this.y = Math.random() * stage.stageHeight;
this.vx = 0;
this.vy = 0;
this.vz = 0;
}
I'm getting an error on the "addChild();" line. I've set up an array made up of different movieclips, now I want to get those movieclips onto the stage and animate them randomly (meaning each one moves around the stage at random with the "animateShapes" function.
What am I missing here ... I'm guessing it's something really simple.
ETA: tried "this.addChild(MovieClip(myShapes));" but still getting Error: "Incorrect number of arguments: Expected 1"