Q:

How do I make strikethrough text programatically in Flex? 

I know I can do this in MXML:
<s:CheckBox label="Some Text" lineThrough="true" />

But how can I do the same thing programatically?  The following doesn't work:
var newCheckBox:CheckBox = new CheckBox;
newCheckBox.label = "Some Text";
newCheckBox.lineThrough = "true"; // Flex code help doesn't see "lineThrough"
dummyContainer.addElement(newCheckBox); // Just some dummy container to add the element to. 

A:

<? xml version="1.0" encoding="utf-8"? >
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955"
               minHeight="600"
               creationComplete="creationCompleteHandler(event)">

    <fx:Script>
        <![ CDATA[
            import mx.events. FlexEvent;
            import spark.components. CheckBox;

            protected function creationCompleteHandler(event:FlexEvent):void
            {
                var checkBox:CheckBox = new CheckBox();
                checkBox.label = "Some text";
                checkBox.setStyle("lineThrough", true);

                addElement(checkBox);
            }
        ]]>
    </fx:Script>

</s:Application>

