We have a flex application and in that we have a screen that taking a lot of time to load, almost 60 seconds.Basically the screen is a very big form. I 开发者_如何学Cwanted to divide the form as a wizard but the client wants a single form with Vertical Scroll on. Now there are 8 sections in the form, each section has two form elements (so around 16 form components) but i have divided each section into a separate component of its own as some pieces are reused .So the whole screen is like
- Form -
- Divided into 8 sections
- Each Sections is an mxml components contained in a
- Almost each components contains two form components kept side to side in horizontal flow i.e something like that.
This screen is taking hell of a lot of time to load. How should i speed it up, please tell the approaches.
Also the main application doesn't take much time to load, this particular screen is loaded on the click of a button and on clicking the button the screen gets stuck because its taking a lot of time to load.
In my experience the Flex 3 (mx) containers in these cases spend an awful lot of time measuring and sizing themselves prior to displaying. The approach I have taken in the past is to reduce the number of nested containers. In particular VBox and HBox seem to be the biggest offenders since they size their children dynamically. Using a Canvas and setting explicit positions/sizes gets rid of a lot of that extra calculating. Better yet, if you can move to Flex 4 (spark) and use Groups instead of the heavier mx containers, you should see a good decrease in the amount of time to render your form.
Also consider using the Runtime shared library (RSL) in your build config. This can help to reduce the size of your code (which could also be why it's taking so long to load).
精彩评论