Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Recent pages and files
Simple ColorKeys Binding Example    

Simple ColorKeys Binding Example

Here is a simple example of binding the fill of a Circle to values of a ComboBox.

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                layout="absolute"
                xmlns:degrafa="http://www.degrafa.com/2007"
                backgroundGradientColors="[#333333, #222222]">
               
    <mx:ArrayCollection id="colorComboData">
        <mx:source>
            <mx:Object label="aqua"/>
            <mx:Object label="chartreuse"/>
            <mx:Object label="mintcream"/>
            <mx:Object label="fuchsia"/>
            <mx:Object label="gold"/>
            <mx:Object label="peru"/>
            <mx:Object label="black"/>
            <mx:Object label="antiquewhite"/>
        </mx:source>
    </mx:ArrayCollection>

    <degrafa:Surface    verticalCenter="0"
                        horizontalCenter="0">
                       
        <!-- Creating a fill. -->               
        <degrafa:fills>
            <degrafa:SolidFill     id="comboColor"
                                colorKey="{colorCombo.selectedItem.label}"/>
        </degrafa:fills>
       
        <!-- Creating a Geometry Group. -->
        <degrafa:GeometryGroup>
       
            <!-- Creating a Circle. -->
            <degrafa:Circle    fill="{comboColor}"
                            radius="200"/>
        </degrafa:GeometryGroup>
       
    </degrafa:Surface>
   
    <mx:ComboBox id="colorCombo" dataProvider="{colorComboData}" x="329" y="10"/>
   
</mx:Application>

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google