Monthly Archives: January 2010

Embedding local system fonts in Flex 4

In a previous example, “Embedding fonts by name instead of location”, we saw how you could embed a font in Flex by specifying the font name instead of a location by using the local() function instead of the src() function when embedding a font.

The following example shows how you can load a system font in Flex 4 by specifying a custom Flex configuration file and specifying a local font path.

Full code after the jump.

Continue reading Embedding local system fonts in Flex 4

Constraining the movement on a Spark TitleWindow container in Flex 4

In a previous example, “Restricting the movement of a pop up Spark TitleWindow container to a single axis in Flex 4”, we saw how you could limit the Spark TitleBar container’s movement to a single axis by modifying the TitleWindowBoundsEvent object’s afterBounds object using the windowMoving event.

The following example shows how you can constrain a Spark TitleWindow container within a Flex 4 application by modifying the TitleWindowBoundsEvent event object’s afterBounds property during the windowMoving event.

Full code after the jump.

Continue reading Constraining the movement on a Spark TitleWindow container in Flex 4

Restricting the movement of a pop up Spark TitleWindow container to a single axis in Flex 4

In a previous example, “Creating a non-draggable Spark TitleWindow container in Flex 4”, we saw how you could create a non-draggable Spark TitleWindow container in Flex 4 by listening for the windowMoving event and calling the stopImmediatePropagation() and preventDefault() methods (or modify the moveArea skin part’s Boolean visible property).

The following example shows how you can limit the Spark TitleBar container’s movement to a single axis by modifying the TitleWindowBoundsEvent object’s afterBounds object using the windowMoving event.

Full code after the jump.

Continue reading Restricting the movement of a pop up Spark TitleWindow container to a single axis in Flex 4

Creating a variable row height Spark DropDownList control in Flex 4

In a previous example, “Creating a variable row height item renderer on a ComboBox control in Flex”, we saw how you could create a variable row height item renderer on a Flex MX ComboBox control by setting the variableRowHeight property on the ComboBox control’s dropdown property.

The following example shows how you can create a variable row height Spark DropDownList control in Flex 4 by setting a custom VerticalLayout object and setting the Boolean variableRowHeight property and the horizontalAlign property.

Full code after the jump.

Continue reading Creating a variable row height Spark DropDownList control in Flex 4

Creating a non-draggable Spark TitleWindow container in Flex 4

The following example shows how you can create a non-draggable Spark TitleWindow container in Flex 4 by listening for the windowMoving event and calling the stopImmediatePropagation() and preventDefault() methods.

Full code after the jump.

Continue reading Creating a non-draggable Spark TitleWindow container in Flex 4

Determining the number of lines in a Spark RichEditableText control in Flex 4

In a previous example, “Determining the number of lines in a TextArea control in Flex”, we saw how you could get the number of lines in an MX TextArea control by using the getTextField() method (in the mx_internal namespace) and the numLines property.

The following example shows how you can get the number of lines in a Spark RichEditableText control in Flex 4 by using the textContainerManager property (in the mx_internal namespace) and the numLines property.

Full code after the jump.

Continue reading Determining the number of lines in a Spark RichEditableText control in Flex 4