For performance reasons I would like to use Array methods to directly
manipulate an array acting as a List component's dataProvider. After
manipulating the array I assumed calling list.invalidateList(); should
refresh the list with the new data. However, when I do that, the first
item is never refreshed unless the list also scrolls. Scrolling the list
will force the first item to redraw correctly.

Here is a code snippet that updates the list:

private function changeArray_invalidateList():void{
   startTime = flash.utils.getTimer();
   dataArray.length = 0;
   for (var i:Number = 0; i < testIterations; i++){
      dataArray.push("A" + i );
   }
   list.invalidateList();
   stopTime = flash.utils.getTimer();
   writeln("changeArray_invalidateList> time: " + (stopTime - startTime));
}

Am I right in assuming this should work?

Also, resetting the dataProvider with the array works. Instead of:
list.invalidateList();

this works:
list.dataProvider = dataArray

and still performs much better than using the IList methods.

Yours truly,
-Brian

--
______________________________________________________________________
Brian Lesser
Assistant Director, Teaching and Technology Support
Computing and Communications Services
Ryerson University
350 Victoria St.
Toronto, Ontario                   Phone: (416) 979-5000 ext. 6835
M5B 2K3                            Fax: (416) 979-5220
Office: AB48D                      E-mail: [EMAIL PROTECTED]
(Enter through LB66)               Web: http://www.ryerson.ca/~blesser
______________________________________________________________________



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to