When i have to add more than one data i like to use objects rather than
arrays like so
var obj:Object = new Object();
obj.name = foo;
obj.age = 18;
obj.weight = 500; //lbs pretty big !
lista.addItem ({label:Shown on list,data:obj});
// then to get the data.
age = lista.selectedItem.data.age;
Try this:
lista.addItem ({label:categorias[n + 1], data:categorias[n + 0],
otherData:categorias[n + 3]});
Lista.selectedItem.otherData;
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of MJorge
Sent: Friday, September 01, 2006 10:47 AM
To: Flashcoders
Thanks for the reply, i will try that.
Many thanks,
Mário
On 9/1/06, Doug Coning [EMAIL PROTECTED] wrote:
Try this:
lista.addItem ({label:categorias[n + 1], data:categorias[n + 0],
otherData:categorias[n + 3]});
Lista.selectedItem.otherData;
-Original Message-
From: [EMAIL
Sorry, try this:
trace(Lista.selectedItem.data);
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Coning
Sent: Friday, September 01, 2006 11:11 AM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] ListBox component, get Data (2nd Value)?!
Try
AFAIK, addItem takes only the label and ONE data element.
To save 2 data elements into the data part, you can make an array with both
the values, and add that array as the data.
Like this:
lista.addItem(categorias[n + 1], [categorias[n + 0], categorias[n + 3]])
Now, to access the second
5 matches
Mail list logo