Use the profiler to see what is taking all of that time. My guess is that setElementIndex causes the UIPanel to be removed and re-added to the display list which then forces a re-layout of all of the child widgets.
In general, if there are display objects you can't see, you'll get better performance if they are not on the display list. -Alex On 8/12/14 8:31 PM, "pnayak" <[email protected]> wrote: >Hi All, > >I have a custom container component let me call it UIPanel that has >several >child components. In some cases there are many within several Group >containers/Viewstacks etc. which I have to use to attain complex layout >and >visuals. Some UIPanels are simple without much content in them. > >There are several instances of the UIPanel on the screen and whenever the >user clicks on anyone of them it has to be the top most one. I achieve >this >by using the setElementIndex to numElements - 1 for the owner of the >component which is a Group. (IVisualElementContainer.setElementIndex(this, >numElements - 1)). > >I've noticed that whenever a UIPanel is complex with several children >like I >mentioned above, clicking on it brings it to the top but there is a delay >of > 1 second. Where as in other cases it is instantaneous. > >I assume this is because the mouse event has to traverse all the children >before it gets to the UIPanel. I'm thinking there has to be a way to >improve >this. The only components interested in the event is the UIPanel and the >top >most child inside the UIPanel which is a DataGrid. > >Is there any other way to improve the response? Is there a container that >is >more lightweight that Group that will be faster but provides layout >functionality? If anyone can provide some inputs will be greatly helpful. > >Thanks, >PN > > > >-- >View this message in context: >http://apache-flex-users.2333346.n4.nabble.com/Improving-mouse-event-respo >nse-tp7638.html >Sent from the Apache Flex Users mailing list archive at Nabble.com.
