I believe its because you're passing in and looking for a new object.
Even though it has the same properties as an object in the collection
its not the same object. Try this:

var smObj:Object = {fieldTag: "small", value:"t"};
var bigObj:Object = {fieldTag: "big", value:"t"};

public function remItem():void
{
   fields.removeItemAt(fields.getItemIndex(smObj));
}

HTH,
Ben


--- In flexcoders@yahoogroups.com, "michaelmatynka"
<[EMAIL PROTECTED]> wrote:
>
> Some more info, and I am getting closer.
> 
> I am using the following function, but it returns a value of -1, out
of bounds, regardless of 
> what value I try to get the index of:
> 
> public function remItem():void{
>               fields.removeItemAt(fields.getItemIndex({fieldTag: "small",
value:"t"}));
>               }
> 
> Remember that the arrayCollection looks like:
> private var fields:ArrayCollection = new ArrayCollection([{fieldTag:
"big", value:"t"}, {fieldTag: 
> "small", value: "t"}]);
> 
> 
> Does anybody know why getItemIndex would return a value of -1?
>


Reply via email to