Run a profiler to see what is taking so much time. It could be just adding that many children, or it could be something each child does when being added that could be optimized or deferred for later.
If it is just adding that many children, you could create an array of them and add them in bunches over several frames. -Alex On 12/8/16, 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/AssetTre >eChild.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.