instead of list.addChild you might want to have a look at using an mx:List
or s:List with useVirtualLayout for that many items

On Thu, Dec 8, 2016 at 9:54 AM, gmanupnorth <gordoncro...@gmail.com> wrote:

> This piece of code is causing significant lag in our UI and was looking for
> suggestions on how to improve it. This builds up a list of approx 1400
> items
> and takes 35-50 seconds to finish.
>
>
> AssetTreeChild is a custom component based on the VBOX AssetTreeChild.mxml
> <http://apache-flex-development.2333347.n4.nabble.com/file/n57076/
> AssetTreeChild.mxml>
>
>
> public function setAgentItem(value:SmartAgentVO):void
>                 {
>                         this.agentItem = value;
>                         if ( value.Children!=null &&
> value.Children.length>0 )
>                         {
>                                         var assetComp:AssetTreeChild;
>                                         for each ( var item:SmartAgentVO
> in value.Children )
>                                         {
>                                                 assetComp = new
> AssetTreeChild();
>                                                 list.addChild(assetComp);
>
> assetComp.setAgentItem(item);
>                                                 assetComp.setStyle("
> textIndent",7);
>                                         }
>                                 }
>                 }
>
>
>
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/Slow-performance-1000-
> objects-tp57076.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>

Reply via email to