Global Arrays
Thanks for the great answers here…
I have a similar project, except that I'm trying to pass an array of objects, so:
I would like something like:
Ti.App.friends[8342873] = {
name: "Mike",
age: 26,
height: 6.1
}
But when I call:
Ti.App.friends[dynamic.id].name
I get an error friends [undefined]. Any ideas?
I tried another syntax:
Ti.App.friends = [{
name: "Mike",
age: 26,
height: 6.1
}];
But then I have to call:
Ti.App.friends[0].name
Which works, except I need to call each friend by id, not by the index of the array.
I would really appreciate some help on this, thanks!