# Compare non dyamic objects

**URL:** https://forum.kirupa.com/t/compare-non-dyamic-objects/260246
**Category:** flash
**Created:** [May 13, 2008, 7:43pm UTC](https://forum.kirupa.com/t/compare-non-dyamic-objects/260246 "2008-05-13T19:43:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jlu](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlu](https://forum.kirupa.com/u/jlu)
#### Post date: [May 13, 2008, 7:43pm UTC](https://forum.kirupa.com/t/compare-non-dyamic-objects/260246/1 "2008-05-13T19:43:49Z")

</div>

Anyone know a good way to filter an array of non dynamic objects using an object as a key? So I have a Tom object and I want to find all the people objects in an array of people that matches the Tom object. Match them based on public properties of the object.

I need some way to compare object properties to each other, but I can’t seem to use a for in loop because the objects aren’t dynamic it’s a custom class with public properties set in the constructor.

I’m guessing I would need to use describeType, with something like Fuzzy Match does ([http://www.kirupa.com/forum/showthread.php?t=33714&highlight=compare+objects](http://www.kirupa.com/forum/showthread.php?t=33714&highlight=compare+objects)). Just can’t seem to wrap my head around it. If anyone has any insight into a method of doing this I would be very grateful.

Thanks!

Jesse

---

<div class="post-metadata">

### Author: ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)
#### Post date: [May 13, 2008, 7:54pm UTC](https://forum.kirupa.com/t/compare-non-dyamic-objects/260246/2 "2008-05-13T19:54:12Z")

</div>

```auto
var matches:int=0
for (var key in object) if (object[key]==otherObject[key]) matches+=1;

```

---

<div class="post-metadata">

### Author: ![jlu](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlu](https://forum.kirupa.com/u/jlu)
#### Post date: [May 13, 2008, 8:43pm UTC](https://forum.kirupa.com/t/compare-non-dyamic-objects/260246/3 "2008-05-13T20:43:03Z")

</div>

[QUOTE=Felixz;2325747]

```auto
var matches:int=0
for (var key in object) if (object[key]==otherObject[key]) matches+=1;

```

[/QUOTE]

It doesn’t seem to find anything. I thought a for in only worked with a dynamic properties? Should I rewrite my object to have dynamic properties? Or is there another way to achieve this?
