Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : Array problem


MartinLindh
11/18/2006 1:00:13 PM
I have made a homemade class called triangle wich exstends the MovieClip class.
It makes special triangles. :)

class Triangle extends MovieClip {
etc...

Now I want to put 20 triangles in an array, but it does not work:

for (i=0; i<20; i++) {
triangelArray.push(new Triangle()); // I try to put 20 triangles in an array
triangelArray[i].calculatePosition(); // I calculate the positons of the
triangles. ( Based om random numbers.)
}

Later when I want to use it I find that all the triangles in the array have
the same possitions.

I'm I doing something badly wrong?
kglad
11/19/2006 5:22:59 PM
AddThis Social Bookmark Button