Compared with Flash development environment, the component library of flex is more attractive. But because of fully function, the size of program commonly will be very large, and to be very slow. The following is 5 advice about how to optimizate your application in Flex.
1. Avoid embed containers inside other containers. Reducing use of relative size and relative position
When the element size in container is described by percent, any change of the size or postion will take the re-position for all subset in container. The calculation will be great if the level of embed is deep.
2. Using lightweight containers like Canvas As far as possible
Canvas is the smallest container and only support absolutely positioin. Most time it could instead HBOx and VBox. Besides, Canvas is a first choice for us when custom containers. It has basic container function and good expand ability.
3. Avoid using large components like DataGrid, AdvancedDataGrid
Large components have powerful function but need high requirement for memory and CPU. Because of the complexity, it is difficult to realize the skin, patterns and itemRenderer.
4. Using paging when deal with data
When using data type control, as far as possible to minimze the amount of showing data. For example Tilelist, it will create all the data whether need or not. It will waste large resoures. When ViewStack 、TabNavigator, etc. dealing with element, data will not be created until they’re shown first time. The unnecessary cost will be avoided.
5. setStyle and styleName
In fact,the skin of Flex components is a visual element. In process of components initialization, they will use current style(for example:styleName) to finish all the skin elements.If we reset the style, the size of components by setStyle, the postion will also be adjusted. Link to the first point, if components in a deep level embed container will cost large calculation.

April 15th, 2008
Ntt.cc 








Posted in
Tags: 
RSS Feed
Email Feed
[...] 原文 [...]
[...] http://ntt.cc/2008/04/15/5-advice-for-developing-ria-and-web-application-in-flex.html [...]
Hi,I translated your article into Chinese.
http://www.asflex.cn/?p=81
Thanks~
This is good information. Can I scrap in my blog?
@Ki-Han Shin
You are welcome, only need put a back link here.
[...] 원문: (링크) [...]