Use BindingUtils to bind property : BindingUtils « Data Model « Flex






Use BindingUtils to bind property

Use BindingUtils to bind property
         
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
  <mx:Script>
    
        import mx.binding.utils.BindingUtils;
        import mx.binding.utils.ChangeWatcher;

        private var _changeWatcher:ChangeWatcher;


        private function initializeHandler(event:Event):void {
            _changeWatcher = BindingUtils.bindProperty(selectedLevel, "text",level, "value");

        }
  
  </mx:Script>
  <mx:VBox>
    <mx:ComboBox id="level">
        <mx:Array>
            <mx:Object label="A" data="1" />
            <mx:Object label="B" data="2" />
            <mx:Object label="C" data="3" />
            <mx:Object label="D" data="4" />
        </mx:Array>
    </mx:ComboBox>

    <mx:TextInput id="selectedLevel" />


  </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Data Binding Through the ActionScript BindingUtils ClassData Binding Through the ActionScript BindingUtils Class
2.Bind with BindingUtils.bindSetterBind with BindingUtils.bindSetter
3.Bind Model with BindingUtils.bindPropertyBind Model with BindingUtils.bindProperty
4.Bind Setter using setter methodBind Setter using setter method