# Movieclip name problem

**URL:** https://forum.kirupa.com/t/movieclip-name-problem/42233
**Category:** Uncategorized
**Created:** [February 6, 2004, 7:00pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233 "2004-02-06T19:00:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![FREDSTER](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@FREDSTER](https://forum.kirupa.com/u/FREDSTER)
#### Post date: [February 6, 2004, 7:00pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233/1 "2004-02-06T19:00:56Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 7:09pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233/2 "2004-02-06T19:09:56Z")

</div>

Welcome to kirupa forum, Fred. 🙂

You need to put the object scope before the brackets:

```auto
joe = _root["bumper"+i];

```

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 7:17pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233/3 "2004-02-06T19:17:30Z")

</div>

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();

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 7:21pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233/4 "2004-02-06T19:21:10Z")

</div>

Ok… could you post all of your code?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 7:32pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233/5 "2004-02-06T19:32:19Z")

</div>

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(distanceX_distanceX+distanceY_distanceY);  
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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 11:39pm UTC](https://forum.kirupa.com/t/movieclip-name-problem/42233/6 "2004-02-06T23:39:22Z")

</div>

Oops… 😛

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.
