Using onMouseDown to remove objects in an array

My subject line pretty much says it all: How on earth do I use the onMouseDown event to remove objects generated by an array?

I’m still programming (if my bumbling can be called that :P) the game I discussed in the ‘Random Object Generation’ thread and I’m using the basic framework of the array function that h88 gave me. Everything is working fabulously, but getting the things to disappear onMouseDown is a problem - it doesn’t work.

Oh, and if I reference Target.prototype.onMouseDown and tell it it to this.unloadMovie, it unloads every single target on the screen instead of the one your mouse is actually over, making for a fairly… lame… game. :slight_smile: I’m pretty sure it’s because every single clip generated by the array is a Target prototype instance and so when the MouseDown occurrs, it unloads every Target movieClip. And I am using a hitTest in the Target.prototype.onMouseDown command, so that doesn’t solve anything… :frowning:

Wow, that got lengthy - sorry for the novel! :beam:

Anyways, any help is, as always, very appreciated :slight_smile:

  • wobbly

*Originally posted by WobblyFork *
My subject line pretty much says it all: How on earth do I use the onMouseDown event to remove objects generated by an array?
:q: What do you mean by generated by an array?

Sorry, that was worded weird… I was in a hurry.

onEnterFrame, the array = createTarget(), a function which attaches a copy of the Target movieClip as well as assigns it a random x-y position, rotation, etc.

That’s what I meant when I said the array ‘generates’ instances of it.

Hooray for everything! I have solved the problem. I lost track of all the things I’ve tried, so I can’t offer the exact thing I was doing wrong :beam:

Anyhoo… no need to worry about this thread, nosirree :slight_smile:

LOL, anyways, it would be better to tell us what was the problem, it would be a reference for other ppl. :slight_smile: