Archive

Posts Tagged ‘Flex’

Setting a custom broken image icon for the Spark Image control in Flex Hero

November 28th, 2010

In a previous example, “Setting a custom broken image skin for the Image control in Flex”, we saw how you could set a custom broken image skin for the Flex Image control by setting the brokenImageSkin style. The following example shows how you can set a custom broken image skin for the Spark Image control [...]

Source:Setting a custom broken image icon for the Spark Image control in Flex Hero

admin Flex, Swf ,

Setting the background color on an invalid Spark Image control in Flex Hero

November 28th, 2010

In a previous example, “Setting the background color on a Spark Image control in Flex Hero”, we saw how you could set the background color on a Spark Image control in Flex Hero by setting the backgroundColor style. The following example shows how you can set the background color on an invalid Spark Image control [...]

Source:Setting the background color on an invalid Spark Image control in Flex Hero

admin Flex, Swf ,

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 ,

Changing the label placement on an MX ButtonBar control in Flex (redux)

November 28th, 2010

In a previous example, “Changing the label placement for a Flex ButtonBar control”, we saw how you could change the button’s label placement relative to its icon in a ButtonBar control in Flex by using the getChildAt() method and labelPlacement property. The following example shows how you can set the label/icon placement on an MX [...]

Source:Changing the label placement on an MX ButtonBar control in Flex (redux)

admin Flex, Swf ,

Adding scroll bars to an Spark Application container in Flex 4

November 28th, 2010

The following example shows how you can add scroll bars to a Spark Application container in Flex 4 by creating a custom skin, adding a Spark Scroller container around the contentGroup skin part, and setting the skinClass style on the Application tag. <?xml version="1.0" encoding="utf-8"?> <!– http://blog.flexexamples.com/2010/11/03/adding-scroll-bars-to-an-spark-application-container-in-flex-4/ –> <s:Application name="Spark_Application_Scroller_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" skinClass="skins.CustomScrollingApplicationSkin"> <s:controlBarContent> [...]

Source:Adding scroll bars to an Spark Application container in Flex 4

admin Flex, Swf ,

Setting the background color on a Spark Image control in Flex Hero

November 28th, 2010

The following example shows how you can set the background color on a Spark Image control in Flex Hero by setting the backgroundColor style. <?xml version="1.0" encoding="utf-8"?> <!– http://blog.flexexamples.com/2010/10/25/setting-the-background-color-on-a-spark-image-control-in-flex-hero/ –> <s:Application name="Spark_Image_backgroundColor_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:Form> <s:FormItem label="backgroundColor:"> <mx:ColorPicker id="cp" selectedColor="black" /> </s:FormItem> <s:FormItem label="source:"> <s:layout> <s:HorizontalLayout /> </s:layout> <s:Button label="image1.jpg" click="img.source = ‘http://helpexamples.com/flash/images/image1.jpg’;" [...]

Source:Setting the background color on a Spark Image control in Flex Hero

admin Flex, Swf ,

Setting multiple style names on a Spark Button control in Flex 4

November 28th, 2010

The following example shows how you can define multiple style names on a Spark Button control in Flex 4 by setting the styleName property to a space separated list of CSS style names. <?xml version="1.0" encoding="utf-8"?> <!– http://blog.flexexamples.com/2010/10/27/setting-multiple-style-names-on-a-spark-button-control-in-flex-4/ –> <s:Application name="Spark_Button_styleName_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:layout> <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle" /> </s:layout>   <fx:Style> .boldWeight { fontWeight: [...]

Source:Setting multiple style names on a Spark Button control in Flex 4

admin Flex, Swf ,

Setting a custom icon on the MX Button control in Flex

November 28th, 2010

The following example shows how you can use the MX TitleWindow container’s close button for an MX Button control icon and skin by setting the skinClass style. <?xml version="1.0" encoding="utf-8"?> <!– http://blog.flexexamples.com/2010/11/08/setting-a-custom-icon-on-the-mx-button-control-in-flex/ –> <mx:Application name="MX_Button_upIcon_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">   <mx:Style> .titleWindowIconAsIcon { upIcon: Embed("Assets.swf#CloseButtonUp"); overIcon: Embed("Assets.swf#CloseButtonOver"); downIcon: Embed("Assets.swf#CloseButtonDown"); disabledIcon: Embed("Assets.swf#CloseButtonDisabled"); }   .titleWindowIconAsSkin { [...]

Source:Setting a custom icon on the MX Button control in Flex

admin Flex, Swf ,

Setting a background fill on an invalid Spark Image control in Flex Hero

November 28th, 2010

In a previous example, “Setting the background color on an invalid Spark Image control in Flex Hero”, we saw how you could set the background color on an invalid Spark Image control in Flex Hero by setting the backgroundColor style on the invalid skin state. The following example shows how you can create a custom [...]

Source:Setting a background fill on an invalid Spark Image control in Flex Hero

admin Flex, Swf ,

Changing the label placement on an MX TabBar control in Flex

November 28th, 2010

In a previous example, “Changing the label placement on an MX ButtonBar control in Flex (redux)”, we saw how you could set the label/icon placement on an MX ButtonBar control in Flex by extending the MX ButtonBar class and setting the navItemFactory property in the mx_internal namespace to a custom class. The following example shows [...]

Source:Changing the label placement on an MX TabBar control in Flex

admin Flex, Swf ,