Searching array question
Hi
I'm using the following to search for the index of a nested array within the array 'folders', that contains an object whose id matches a certain value. The objects being searched are at position 0 of each nested array.
function find(id):int
{
for (var i:int = 0; i < folders.length; i++)
{
if(folders[0].id == id) return i;
}
}
find("my_value");
...gives me the error: function does not return a value
But if I get rid of the :int...
function find(id)
...it works.
It's definitely an integer returning, as I'm able to use it mathemtaically later.
Why does this happen?
Thanks
