Tag Archives: mx internal

Using tab stops with the TextArea control in Flex

The following example shows how you can set tab stops on the Flex TextArea control by setting the tabStops property on a TextFormat object and setting the defaultTextFormat property or setTextFormat() method, or by setting the TextArea control’s htmlText property to an HTML string with a <TextFormat> tag.

Full code after the jump.

Continue reading Using tab stops with the TextArea control in Flex

Determining your Flex SDK version number

The following example shows how you can determine your Flex SDK version within a Flex application by using the internal mx_internal::VERSION property.

You can also find the version number by doing one of the following:
(a) Viewing the flex-sdk-description.xml file in your Flex SDK’s root directory:

<?xml version="1.0"?>
<flex-sdk-description>
    <name>Flex 4.0</name>
    <version>4.0.0</version>
    <build>3934</build>
</flex-sdk-description>

(b) At a command prompt, navigate to your Flex SDK’s /bin/ directory and type mxmlc -version:

C:\\dev\\flexSDKs\\4.0.0.3934\\bin>mxmlc -version
Version 4.0.0 build 3934

Full code after the jump.

Continue reading Determining your Flex SDK version number

Creating a non-editable NumericStepper control in Flex

The following example shows how you can create a non-editable Flex NumericStepper control (users cannot type numbers directly into the control, but can still use the up arrow, down arrow, and keyboard to change the value) by setting the editable property on the nested inputField TextInput control.

Full code after the jump.

Continue reading Creating a non-editable NumericStepper control in Flex

Creating an Alert control with non-selectable text

Ever wonder how you could create an Alert control but make the text be non-selectable (without subclassing the Alert control, that is)? Well, here’s how.

By using the hidden powers of the “mx_internal” namespace, you can access the Alert control’s internal alertForm property (an AlertForm object — for more information see the AlertForm.as class in the mx.controls.alertClasses package) and from there modify the internal textField property (a UITextField object), and set the selectable property to false.

Taa-daa! Non-selectable text.

Full code after the jump.

Continue reading Creating an Alert control with non-selectable text

Setting an icon in an Alert control

Similar to the previous post where we covered a couple of techniques for embedding an icon into a Button control, this post explores embedding an icon into an Alert control. An icon in an Alert control appears to the left of the alert’s message text, but the second example will show how you can easily tweak the code to also add icons to the nested buttons controls within the alert dialog itself. See the full code after the jump.

Continue reading Setting an icon in an Alert control