"Getting an Index Position from an Array" doubt

Hello

I’ve used the tutorial I found in the tutorials section for Flash MX

http://www.kirupa.com/developer/actionscript/tricks/indexposition.htm

but I’m stuck with a question, since, for the project I’m working, this keeps returning -1.
Assuming this:

--------- as in the tutorial ------------
Array.prototype.getIndex = function(data) {
for (i=0; i<this.length; ++i) {
if (this* == data) {
return i;
}
}
return -1;
};
resources = new Array(“a”, “b”, “c”, “d”, “e”, “f”, “g”, “h”);
location = resources.getIndex(“e”);
trace(location);
----------- xxx -----------------------

if you want to find the location of your data you just type it when you are calling the function.
My problem: I can’t seem to make it work to find the location of a “composed” data, that is, in an array with (“da”,"db,“dc”,“dd”,“de”,“df”) I can only get the index of “de” if I type it directly. If I try using this:

Choice = “d”+letter;
location = resources.getIndex(Choice);
trace(location);

It always return -1

Why? I’m I doing something wrong?

Thanks for the tutorial and thanks for any help possible.

Crop