Monthly Archives: October 2009

Determining how much of an item is visible in a scrolling VGroup container in Flex 4

In a previous example, “Determining the first and last visible item in a scrolling VGroup container in Flex 4”, we saw how you could determine the first and last item in a Spark VGroup container’s view by using the firstIndexInView and lastIndexInView properties on the VGroup container’s layout property.

The following example shows how you can determine how much of an item is visible in a scrolling VGroup container in Flex 4 by using the fractionOfElementInView() method.

Full code after the jump.

Continue reading Determining how much of an item is visible in a scrolling VGroup container in Flex 4

Determining the first and last visible item in a scrolling VGroup container in Flex 4

The following example shows how you can determine the first and last item in a Spark VGroup container’s view by using the firstIndexInView and lastIndexInView properties on the VGroup container’s layout property.

Full code after the jump.

Continue reading Determining the first and last visible item in a scrolling VGroup container in Flex 4

Setting word wrapping on a Spark List control in Flex 4

The following example shows how you can enable word wrapping on a Spark List control in Flex 4 by overriding the default layout with a VerticalLayout object and set its horizontalAlign property to “justify” (instead of the default “contentJustify”).

Full code after the jump.

Continue reading Setting word wrapping on a Spark List control in Flex 4

Setting a gradient background fill on a Spark TextArea control in Flex 4

In a previous example, “Setting a gradient background fill on a Halo TextArea control in Flex 4”, we saw how you could create a linear gradient background on a Halo/MX TextArea control in Flex 4 by creating a custom border skin with a LinearGradient fill and setting the borderSkin style.

The following example shows how you can create a linear gradient background on a Spark TextArea control in Flex 4 by modifying the background fill in the TextArea control’s skin to a LinearGradient.

Full code after the jump.

Continue reading Setting a gradient background fill on a Spark TextArea control in Flex 4

Setting a gradient background fill on a Halo TextArea control in Flex 4

In a previous example, “Setting the background fill color on a Halo TextArea control in Flex 4”, we saw how you could set the background fill color on the Halo TextArea control (with default Spark skin) in Flex 4 by setting the contentBackgroundColor style.

The following example shows how you can create a linear gradient background on a Halo/MX TextArea control in Flex 4 by creating a custom border skin with a LinearGradient fill and setting the borderSkin style.

Full code after the jump.

Continue reading Setting a gradient background fill on a Halo TextArea control in Flex 4