Posts Tagged ‘Flex’

Flex 4 <s:Rect/> height limit of 10,000?

In my post about vertical scroll speed I show a code example of a scroller with several nested groups. A typical design of websites these days is to have a content area in the middle with an ever-expanding height and some sort of repeating background or colors on the sides – Just look at the layout of the majority of blogs, including my own.

Writing a flex app with the same design where you can scroll a lot of content vertically with a solid background color is a pretty typical use-case, but you will quickly find a limitation with using the primitive class Rect as a background: maxHeight = 10,000.

Read more…

Object/Dictionary Reference counting and Memory Management

March 7, 2010 Leave a comment

Since it is such an important topic and such a problem for the community, I thought I would make another post pertaining to optimizing for the garbage collector.

I was looking for information in the object/dictionary docs completely unrelated to memory management, but ran across this statement:

As long as any reference to the object exists, the garbage collection system will not recover the memory that the object occupies. If the value of myObject is changed such that it points to a different object or is set to the value null, the memory occupied by the original object becomes eligible for garbage collection, but only if there are no other references to the original object.


Yes, you do need to explicitly set all non-simple types to null and splice/delete array indices and hash key entries.

Read more…

Conditional Compilation

February 3, 2010 Leave a comment

There is a cool compiler flag that allows you to conditionally compile code into your binaries called -define.

This really cool feature has an annoying side effect though:

Read more…

Unknown error generating output application.xml files

January 15, 2010 Leave a comment

I’ve been implementing a new project using the TDD methodology using some of the new flash builder tools – specifically the “Execute FlexUnit Tests” method when you right click on a test case class.

When the project matured enough to check into SVN, I noticed a weird error:

Unknown error generating output application.xml files.

Read more…

Flex 4 Text Performance Issues

September 24, 2009 Leave a comment

We have been running into performance issues with a new MMSP level application where we render anywhere from 1 to thousands of items. We narrowed it down to the List, DataGroup, ItemRenderer, and related items and decided to run some tests to see what about them was taking so long.

We created an app that creates 5 lists, each with their own data group and item renderer files. We created one with vectors/gradients only (NoLabelNoBind), vectors/gradients with labels and no binding, vectors/gradients with labels and binding, and then two more with richtext in stead of labels.

We rendered 100, 200, 300, 400, and then 500 items, all of which finished except the 500 item test, where it got a 15 second script timeout exception thrown. Maybe our tests are bogus and we are doing something wrong, but we are ignorant of those techniques if that is the case. The bottom line from this test app is to use labels where RichText isn’t needed and don’t use binding but in stead set the properties of the labels from the Dto/Vo objects as the renderer receives the new item.

Per the adobe help docs, we tried adding the “useVirtualLayout” property to the layout property on the datagroup and list with the same results.

Speed Test

Speed Test

The associated source can be found here.