code-tutorial.com

The best resources for developers

Is programming data binding actually painless?

BindingUtils.bindSetter(nameChanged, selectedEmployee, "name");
private function nameChanged( newName : String ) : void 
public function set currentEmployee( employee : Employee ) : void {
    if ( _currentEmployee != employee ) {
        if ( _currentEmployee != null ) {
            currentEmployeeNameCW.unwatch();
        }

        _currentEmployee = employee;

        if ( _currentEmployee != null ) {
            currentEmployeeNameCW = BindingUtils.bindSetter(currentEmployeeNameChanged, _currentEmployee, "name");
        }
    }
}
BindingUtils.bindSetter(currentEmployeeNameChanged, this, ["currentEmployee", "name"]);

Tags: apache-flex data-binding mxml actionscript-3

Source: By Rytmis as answer to the question

This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 2.5


Related code-snippets: