I have a custom component called Tag
package bin {
public class Tag {
public var count:int;
public var text:String;
public function Tag() {}
}
}
I have a bunch of these tags in a two arrays. I want to be able to call
arr0.indexOf( arr1[0] ) //line 1
// or
arr0[0] == arr1[0] //line 2
and only have the text field be compared. ie
tag{text:"hi", count:0} == tag{text:"hi", count:5}
Even though the counts differ the above result would be true, likewise if the two tags are in the different lists I want them to match up to each other as would in line 1
In java the solution would be to implement the comparable interface and overwrite the compare method to suit my needs. I could not find any documentation on such a solution in flex. Nor did my attempts at making a compare method work.
I am using Flex 3 fyi