Flex: X-out Label?

I am trying to make a shortcut with an X above it. So I can say it is price with X for price. I want to make it a component because I will be using it more than once. I want the X to be close to the same size as the text, so that it isn't a giant X over small text, or a small X over large text.

Here is the code I tried that didn't do anything:

<?xml version="1.0" encoding="utf-8"?>
<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        <![CDATA[

            override public function set text(value:String):void
            {
                super.text = value;

                var g:Graphics = this.graphics;
                g.clear();
                g.lineStyle(3,0xFF0000);
                g.lineTo(this.width,this.height);
                g.moveTo(0,this.height);
                g.lineTo(this.width,0);
            }       

        ]]>
    </mx:Script>

</mx:Label>

      

+1


a source to share


1 answer


See this post. It provides a component to do this for you.



It is currently not supported.

+1


a source







All Articles