# If statement == Values match but returns false

**URL:** <https://forum.kirupa.com/t/if-statement-values-match-but-returns-false/164213>\
**Category:** Uncategorized\
**Created:** [September 29, 2005, 10:25am UTC](https://forum.kirupa.com/t/if-statement-values-match-but-returns-false/164213 "2005-09-29T10:25:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frederique](https://avatars.discourse-cdn.com/v4/letter/f/e47c2d/32.png) [@frederique](https://forum.kirupa.com/u/frederique)\
**Post date:** [September 29, 2005, 10:25am UTC](https://forum.kirupa.com/t/if-statement-values-match-but-returns-false/164213/1 "2005-09-29T10:25:11Z")

</div>

Hi there,  
I’ve got the following code here which is giving me some grief. The problem is the if statement always returns false even though I know that the two values are definitely the same somewhere through the loop as I have traced the values. All I can think of is that teamCode\* is a string so its not truely == to specialcode. Any thoughts or help much appreciated.

```auto
_global.specialcode = specialcode.text;
teamCode = new Array();
var ranking:XML = new XML();
ranking.load("myxml.xml");
ranking.ignoreWhite = true;
ranking.onLoad = function(success) {
     if (success) {
          var entry_arr = this.firstChild.childNodes;
          for (var i = 0; i<entry_arr.length; i++) {
               teamCode* = entry_arr*.attributes.id;
               trace("Code ------- "+teamCode*);
               trace(specialcode);
               if (specialcode == teamCode*) {
                    trace("YAY");
               } else {
                    "boo";
               }
          }
     }
};

```

Many Thanks
