Hi,
I have a bunch of numeric variables in an array. They correspond to the _y value of some movieclips in the movie. These values change through the movie, and at the end I’m trying to figure out which movieclip’s ._y is the lowest. The problem is sometimes more than one movieclip ends up in the same spot. Here’s what the code looks like:
var squareY:Number = shapes_mc.square_gfx.box._y;
var circleY:Number = shapes_mc.circle_gfx.box._y;
var triangleY:Number = shapes_mc.triangle_gfx.box._y;
var hexagonY:Number = shapes_mc.hexagon_gfx.box._y;
var rectangleY:Number = shapes_mc.rectangle_gfx.box._y;
var ovalY:Number = shapes_mc.oval_gfx.box._y;
var shapesY:Array = new Array(squareY, circleY, triangleY, hexagonY, rectangleY, ovalY);
categsY.sort();
/* find out which shape is lowest */
if (categsY[0] == squareY){
square_mc._mc.alphaTo(100, 1, “linear”, 1);
}
then more if statements for the other movieclips. It works, but if more than one movieclip end at the same _y position, they all fade in. Is there a way to get just one of them?