This is my first time posting, so I hope I am doing this correctly. Here is the problem, I created a loop for “i”. I am trying to search thru all items called bumper# in my array (bumper1, bumper2, etc.) After a certain IF STATEMENT is met, I’d like to delete the bumper found with a removeMovieClip.
joe=[“bumper”+i]; (located on the root also)
trace(typeof(joe));
this is returning “object” instead of “movieclip”
After an IF STATEMENT =
joe.removeMovieClip();
Where is the problem? Any help would be greatly appreciated.
on (release) {
//find coordinates of each box
A = getProperty(bumper1, _x);
B = getProperty(bumper1, _y);
for (var i = 0; i<dockA_ctrHoleArray.length; i++) {
nearestHole=“dock1.”+dockA_ctrHoleArray*;
X = getProperty(nearestHole, _x)+ getProperty(dock1, _x);
Y = getProperty(nearestHole, _y)+ getProperty(dock1, _y);
//calculate distance along each axis
distanceX = (a-x);
distanceY = (b-y);
//calculate distance from center to center
hypotenuse = Math.sqrt(distanceXdistanceX+distanceYdistanceY);
if (hypotenuse<25) {
bumper1.removeMovieClip();
loadMovie(“part_bumper.swf”, nearestHole);
}
}
}
What I am trying to do here is replace BUMPER1 and DOCK1 with variables. If I check every BUMPER# against every DOCK#, then execute removeMovieClip. This code will be modified with addition loops as needed later.
I think it would be easier for me if you could just attach your FLA. It might be an addressing issue or something like that, which I can’t debug without taking a look at the movie.