Sunday, December 18, 2005

Wait for a frame !

I started working with Flash only after I joined MM to work on Flex and today I encountered my first frame problem ! When you set the dataProvider or selectedIndex of a control you cannot access the seletedItem immediately :-( You need to wait for a frame.

The requirement stems from the fact that it may be required to fetch the data before selectedItem can point to the correct item.

In the past while reading about improving performance I have read about lazy evaluation where in you defer the computation till the value is required. Does waiting for a frame fall into this category ? I feel it does because the evaluation of selectedItem is deferred and user is allowed to change dataProvider / selectedIndex (which may be the case mostly) without evaluating selectedItem.

In the past I also noticed a performance improvemnt being done by increasing the frame rate to a high value for a brief period of time and then using the normal frame rate value otherwise.

No comments: