*Hello there!, I need to populate only 100 items on a dataProvider that is shown in a list component. even if the items are more than 500 or even 1000, I only want 100 items, first all the items with the camera on, and fill the rest to complete 100 in total to be on the DataProvider. Using ActionScript 3.0 (Flash CC):
UPDATE: basically, what I need is: I have a videochat app in flash, so when there are hundreds of users the app becomes slow due to the list component populating hundreds of items(users), so I would like to have at least 100 users on the list giving priority to the users streaming live video. does it make sense? :) thanks – Alex just now edit
*
Code:
function syncEventHandler(event:SyncEvent){
list1.removeAll();
for (var i in users_so.data){
if (users_so.data[i] != null)
{
var clientObj = users_so.data[i];
//if user is streaming add it first then complete 100 with the rest.
list1.addItem({label:clientObj.UserName});
}
}
}
Thank you for taking time for this one!