Movieclip name problem

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.

Welcome to kirupa forum, Fred. :slight_smile:

You need to put the object scope before the brackets:

joe = _root["bumper"+i];

See http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12082#post85182 for more info.

Nope, that doesn’t seem to work

this doesn’t work:

joe = _root[“bumper”+i];

however, this does work when spelling out the movieclip name
bumper1.removeMovieClip();

Ok… could you post all of your code?

O.K., you asked for it:

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.

many thanks

Oops… :stuck_out_tongue:

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.