Flash Builder Örnekleri

Flash Builder ( Flex 4 ) Makaleleri

  • Ana SayfaAna Sayfa

01 Mayıs 2010
Posted by admin

ColorPicker an Array of color, label, and description

The following example shows a ColorPicker that uses an Array of Objects with three fields: color, label, and description:


Turkish

bur örnek ile colorpicker içerisinde renklere isim ve açıklama ekleyebilirsiniz.

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
 
	<mx:Script>
		<![CDATA[
			import mx.events.ColorPickerEvent;
			import mx.events.DropdownEvent;
 
			[Bindable]
			public var complexDPArray:Array = [
				{label:"Yellow", color:"0xFFFF00", 
					descript:"A bright, light color."}, 
				{label:"Hot Pink", color:"0xFF66CC", 
					descript:"It's HOT!"}, 
				{label:"Brick Red", color:"0x990000", 
					descript:"Goes well with warm colors."}, 
				{label:"Navy Blue", color:"0x000066", 
					descript:"The conservative favorite."}, 
				{label:"Forest Green", color:"0x006600", 
					descript:"Great outdoorsy look."}, 
				{label:"Grey", color:"0x666666", 
					descript:"An old reliable."}]
 
			public function openEvt(event:DropdownEvent):void {
				descriptBox.text="";
			}
 
			public function changeEvt(event:ColorPickerEvent):void {
				descriptBox.text=event.currentTarget.selectedItem.label
					+ ": " + event.currentTarget.selectedItem.descript; 
			}
		]]>    
	</mx:Script>
 
	<mx:Style>
		.myStyle {
			swatchWidth:25;
			swatchHeight:25;
			textFieldWidth:95;
		}    
	</mx:Style>
 
	<mx:ArrayCollection id="complexDP" source="{complexDPArray}"/>
 
	<mx:VBox>
		<mx:TextArea id="descriptBox" 
					 width="150" height="50"/>
		<mx:ColorPicker id="cp" 
						height="50" width="150"
						dataProvider="{complexDP}" 
						change="changeEvt(event);" 
						open="openEvt(event);" 
						editable="false"/>      
	</mx:VBox>
 
</mx:Application>

Demo :

No Comments

Posted Under <mx:ColorPicker>

No Comments Yet

You can be the first to comment!

Leave a comment

* = Required

    • Posts
    • Twitter
    • Flickr
     

    Flex’te...

    Hatalar - Errors

     

    As3 Email...

    Action Script Hints

     

    ColorPicker an...

    <mx:ColorPicker>

    Seonokta.com kurumsal sitelere seo hizmeti sunmaktadır. Sitenizin Google aramalarında daha üstte olmasını... http://ff.im/oMiZE

    follow me on
    twitter

    DSC_0076IMAG0274fireworks2009_0807blackwatchaug090114
  • Categories

    • Action Script Hints
    • Charts – <mx:Chart>
    • Components – <fx:Component>
      • <mx:Accordion>
      • <mx:ColorPicker>
      • <mx:PopUpMenuButton>
      • <s:Spinner>
    • Genel – <s:Application>
    • Hatalar – Errors
  • Archives

    • 2010
      • Ocak
      • Şubat
      • Nisan
      • Mayıs
      • Haziran
      • Temmuz
    • 2009
      • Aralık
  • Bağlantılar

    • kiralık uçak

This site is using the Handgloves WordPress Theme
Designed & Developed by George Wiscombe

Subscribe via RSS