Hi all,
I am building a complex modular AIR app and in one of my modules I have a couple of touch scrolling elements.
So in this module I have a main scroller that can hold and scroll other sub-elements which have nested scrollers, like the date picker on the iPhone.
One sub-element holds 4 of these date pickers.
The problem is that when I have more than 4 sub-elements in the main scroller and I scroll these sub-elements (not the date pickers in the sub-elements but the sub-elements themselves), framerate drops to 4-7FPS from 30FPS. When not scrolling, framerate is 30FPS. When scrolling only the date pickers inside the sub-elements, framerate is 30FPS. One of the pickers contains 170 values and the others less, so the four of them contains 230 values together.
I’ve checked with a profiling software and I see rendering and pre-rendering taking up 80-90% of rendering capacity.
What is weird that CPU usage is not more than 18% when running the whole application with this lagging scroller. So I don’t really get it why flash VM don’t use more CPU to maintain the framerate. Are there some settings to achieve this?
Or how would I go about optimizing those pickers? Would it be a good idea to enable only those scrolled elements that are in the visible area? Would it be sufficent to set visible property to false? Because if I have to pass those values into removeChild, then I’d still need to maintain another list with the position of each item to be able to put them back, when the not on stage item is theoretically back on the visible area. That sounds complicated and I don’t know if that would solve this huge performance drop better then just setting visibility to false.
Thanks in advance for helping me out! And in case you need more info, don’t hesitate!
Greg