*Hey there! I'm looking to only display 100 items in a list component from a dataProvider, even if it contains more than 500 or even 1000 items. Specifically, I want the first 100 items with cameras on to be included, and then fill the rest to reach a total of 100 within the DataProvider. Utilizing ActionScript 3.0 (Flash CC):
UPDATE: Essentially, what I require is this: In my video chat app in Flash, when there are hundreds of users, the app starts lagging because the list component is populating hundreds of users. Therefore, I'd like to limit the list to only show 100 users, giving priority to those who are currently live streaming video. Does that make sense? :) Thank you! – 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});
}
}
}
Thanks for taking the time to read this!