Flex

Spark item renderer blinks on hover

Custom Spark item renderer may blink when it gets hovered. This happens when item renderer uses states. Here is the example:

BadItemRenderer gets removed and added back on hover. GoodItemRenderer is not removed on hover because it overrides…

Cloud Layout

Here is the CloudLayout.as [plain] that does nice Web 2.0 tag cloud:


View Source

Horizontal Multiline Layout

Sometimes it is necessary to place elements horizontally (like HorizontalLayout) in several lines instead of just one line:

Fit buttons in the toolbar

Sometimes buttons does not fit in the toolbar:

Spark Tree

Unfortunately Flex 4 does not have Spark Tree and MX Tree has 99 bugs at this moment.

In our project we were in need of Spark-based Tree for some time so inspired by Alex Harui I wrote…

Runtime icons for Flex components

Bitmap or BitmapData can not be used as icon in Flex components like MX Button because they want Class that will instantiate as BitmapAsset.

Solution

Create cache of special classes. Each of them will be able to become an icon.…

Change font size in the whole app with Ctrl+/-

Browser supports changing page font size with Ctrl+/- and Ctrl+scrolling, but Flex applications are not affected by this. People with failing sight can not use such applications.

Solution for Flex 4

Work with StyleManager and set fontSize style at runtime.…

Generate color theme for Flex application using Camera

User may want to make Flex application look like himself, his room or his jacket.

Solution

Use Flex 4 color styles chromeColor, accentColor and screenshot from the Camera.

http://kachurovskiy.com/f/ria/10/camera-theme/ColorSchemes.html

Flex 4 provides coloring via styles…