Home > Flex, Swf > Clearing a style on the Spark Button control in Flex 4

Clearing a style on the Spark Button control in Flex 4

November 28th, 2010

The following example shows how you can clear a style on the Spark Button control in Flex 4 by using the clearStyle() method. <?xml version="1.0" encoding="utf-8"?> <!– http://blog.flexexamples.com/2010/10/27/clearing-a-style-on-the-spark-button-control-in-flex-4/ –> <s:Application name="Spark_Button_clearStyle_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <s:controlBarContent> <s:Button label="bold" fontWeight="bold" click="btn.setStyle(’fontWeight’, FontWeight.BOLD);" /> <s:Button label="no bold" click="btn.clearStyle(’fontWeight’);" /> </s:controlBarContent>   <fx:Script> <![CDATA[ import flash.text.engine.FontWeight; ]]> </fx:Script>   [...]

Source:Clearing a style on the Spark Button control in Flex 4

admin Flex, Swf ,