If statement == Values match but returns false

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.

_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