Monthly Archives: November 2009

Creating a custom component using the Definition tag in Flex 4

In a previous example, “Creating a custom component using the Component tag in Flex 4”, we saw how you could create a simple, inline custom component in Flex 4 using the Component tag and className property and then instantiating new instances using ActionScript and MXML.

The following example shows how you can create a new custom component using the Definition tag in Flex 4.

Full code after the jump.

Continue reading Creating a custom component using the Definition tag in Flex 4

Setting a custom horizontal scroll bar skin on a Spark List control in Flex 4

The following example shows how you can apply a custom horizontal scroll bar skin on the Spark List control in Flex 4 by setting the skinClass style.

Full code after the jump.

Continue reading Setting a custom horizontal scroll bar skin on a Spark List control in Flex 4

Styling the horizontal and vertical scroll bars on a Spark List control in Flex 4

The following example shows how you can set a base theme color on a Spark List control’s horizontal and vertical scroll bar by setting the chromeColor style.

Continue reading Styling the horizontal and vertical scroll bars on a Spark List control in Flex 4

Setting the joint style on a Spark Border container in Flex 4

The following example shows how you can set the joint style on a Spark Border container in Flex 4 by setting the borderStroke property to a custom stroke object and set the joints property to a static constant from the flash.display.JointStyle class.

Full code after the jump.

Continue reading Setting the joint style on a Spark Border container in Flex 4

Auto scrolling the contents of a VGroup container in Flex 4

The following example shows how you can tab through a series of Spark TextInput controls in Flex 4 and auto-scroll the VGroup container so that the currently focused text field has focus by using the fractionOfElementInView() method, getScrollPositionDeltaToElement() method, and verticalScrollPosition property.

Full code after the jump.

Continue reading Auto scrolling the contents of a VGroup container in Flex 4