# Shouldn't this work? Array related question

**URL:** <https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373>\
**Category:** Uncategorized\
**Created:** [August 13, 2003, 3:12am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373 "2003-08-13T03:12:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![blah\_de\_blah](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@blah\_de\_blah](https://forum.kirupa.com/u/blah_de_blah)\
**Post date:** [August 13, 2003, 3:12am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/1 "2003-08-13T03:12:48Z")

</div>

So i’m trying to figure out how to drop a dragged object onto any box, but no where else. So i tried using this:

[AS]  
targArray = new Array();  
targArray = [theTarget1, theTarget2, theTarget3, theTarget4, theTarget5, theTarget6, theTarget7, theTarget8, theTarget9];  
[/AS]

theTarget1 and stuff are all instance names of the box. Then later on, i use:

if (eval(this.\_droptarget) == targArray) {

So doesn’t that mean if i drop the target anywhere on the instances then do whatever is next??

The bad thing is, it doesn’t seem to be working :-\ Anyone know whY? thanks! I’m helping someone out for this problem, but i got stuck myself 😛

---

<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:** [August 13, 2003, 4:38am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/2 "2003-08-13T04:38:59Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?threadid=31327](http://www.kirupaforum.com/forums/showthread.php?threadid=31327)

---

<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:** [August 13, 2003, 5:04am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/3 "2003-08-13T05:04:57Z")

</div>

[AS]  
for (i=0; i\<=targArray.length; i++) {  
if (eval(this.\_droptarget) == targArray) {  
//dowhatever  
}  
}  
[/AS]

Do you mean something like that? because it seems like i should be replacing targArray in the second line with something else… :-\

EDIT: btw, what does the break do?? 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:** [August 13, 2003, 6:58pm UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/4 "2003-08-13T18:58:27Z")

</div>

break goes out of the loop. it stops the loop from running.

---

<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:** [August 14, 2003, 4:49am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/5 "2003-08-14T04:49:13Z")

</div>

o ok thanks, but how should i change the code? because it seems wrong and not working :-\

---

<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:** [August 14, 2003, 5:26am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/6 "2003-08-14T05:26:56Z")

</div>

[AS]if (eval(this.\_droptarget) == targArray\*) {[/AS]

---

<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:** [August 14, 2003, 5:30am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/7 "2003-08-14T05:30:47Z")

</div>

oo yea its workin now, 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:** [August 14, 2003, 5:32am UTC](https://forum.kirupa.com/t/shouldnt-this-work-array-related-question/28373/8 "2003-08-14T05:32:37Z")

</div>

No problem. 😉
