User a DataProvider instance instead of an Array
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/data/DataProvider.html
You then change the dataprovider instance and the list will detect the changes.
import fl.data.DataProvider;
var data:DataProvider = new DataProvider([{label:"user 01"}, {label:"user
02"}]);
function addClickHandler(evt:MouseEvent):void {
var user:Object = {label:"new user"};
data.addItem(user);
}
user_list.dataProvider = data;
add_btn.addEventListener(MouseEvent.CLICK, addClickHandler);
regards,
Muzak
----- Original Message -----
From: "Alexander Farber" <[email protected]>
To: "Flash Coders List" <[email protected]>
Sent: Friday, January 23, 2009 10:11 PM
Subject: [Flashcoders] updateAll event to notify List that dp changed - gonein
AS3?
Hello,
I'm porting a webchat-like application from AS2 to AS3
with a list of usernames displayed in a List component.
In AS2 I had to save those usernames into an Array
and then send an event "updateAll" to the List
component to let it know that its dataProvider
(an Array with webchat-usernames) has changed.
But now when reading AS3 docs I can't find such an event.
I've tried just fl.controls.List.removeAll() and then
a series of addItem() and don't notice any flickering
or problems yet. Is the updateAll-event gone in AS3?
Thank you
Alex
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders