Re: [flexcoders] invalidateList() problem
On 5/12/06, Brian Lesser <[EMAIL PROTECTED]> wrote: For performance reasons I would like to use Array methods to directlymanipulate an array acting as a List component's dataProvider. AfterOne more thing you could try instead of manipulating the underlying Array directly is, calling disableAutoUpdate() before you make a major update and then calling enableAutoUpdate() just after. This would ensure that the view isnt updated after each addItem(), instead the events would be queued and dispatched when the enableAutoUpdate is called. This would be faster than calling addItem() multiple times with auto-update enabled. But I am not sure if this would be faster than the technique you are currently using. -rishi -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] invalidateList() problem
On 5/12/06, Brian Lesser <[EMAIL PROTECTED]> wrote: > 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. I think you have to call refresh() on the collection. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] invalidateList() problem
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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.