How Flex treats strokes on GraphicElements can be a little tricky. This post explains how the stroke of a GraphicElement contributes to the measured size of a spark Group.
Continue reading Measuring a GraphicElement with a Stroke in a Group
This post goes over the basics of writing a very simple custom layout that supports virtualization in spark. It assumes that you have already built a custom layout that handles the real (non-virtual) case and are comfortable doing so.
Continue reading Learn how to create a simple virtual layout in Flex 4
Sometimes it’s nice to keep an eye on the memory of an application without involving the Flash Builder profiler. This post demonstrates a simple and lightweight component that graphs the value of the Flash Player’s System.totalMemory over time. The chart can be very useful for noticing spikes in memory that might require further investigation with the profiler.
Continue reading Memory Graph to track Flash Player total memory usage
The default spark List will add a horizontal scroll bar when the contents of the List are wider than its width. This post shows how to change that behavior using a custom item renderer so that a truncation mark like an ellipsis is used instead.
Continue reading List with truncation instead of a horizontal scroll bar
The ItemRenderer class in Flex 4 has an itemIndex property that was added after beta2. You can use this property within your item renderer to display the row number or index of an item in a spark List.
Continue reading Displaying the row number or index in a spark List
ItemRenderer has logic built in that changes between some standard states like normal, hovered, selected, etc. You can supplement this logic by overriding ItemRenderer.getCurrentRendererState(), or do away with the built in states altogether by subclassing DataRenderer instead of ItemRenderer.
Continue reading Using DataRenderer to add custom states to a spark List renderer
HTML’s select control included a tag called optgroup where you could group items in the drop down together and provide a heading that wasn’t selectable. This post looks at making an equivalent component in Flex 4 by extending DropDownList.
Continue reading Spark DropDownList equivalent of the HTML optgroup tag
In spark components, the focusSkin is treated differently from the normal skin. Unlike the skin of a spark component, the focusSkin is not automatically sized or positioned by the component. Instead, it is added as the first child of the component. In addition, if the focusSkin has a property called
target is set to point to the parent component.
Continue reading Custom focus skin for spark components in Flex 4
The VerticalLayout and HorizontalLayout classes now support both the horizontalAlign and verticalAlign properties. This brings the VGroup and HGroup components in line with how the VBox and HBox halo controls worked.
Continue reading Major axis alignment now supported in spark
I recently created a form in Flex that required using multiple DropDownLists with a custom item renderer that loads in preview images of each item. This was really easy to do initially, but I noticed a couple performance issues that bothered me. I decided to improve the performance by implementing a simple caching strategy.
Continue reading Caching images loaded from a spark item renderer