Don't understand why im getting these errors, can anybody help?
I have just created an arrayCollection from a HTTPService that reads a table
from my database. I am trying to check to see if the new user has entered an
already used account name.
After reading a number of articles I discovered searching the arrayCollection
was possible but only after sorting the collection, this is what I am having
trouble with.
Here is my code:
private function userHandler(event:ResultEvent):void
{
acUsers = event.result.response.data.row;
acUsers.fields = [new SortField("usraccount", true)];
acUsers.sort=acUsers;
acUsers.refresh();
}
I am getting the following error at (acUsers.sort=acUsers;):
implicit coercion of a value of type
mx.collections:ArrayCollection
to an unrelated type
mx.collections:Sort.
and also an error at (acUsers.fields = [new SortField("usraccount", true)];)
Access of possibly undefined property
fields through a refrence with static type mx.collections:ArrayCollection.