I’m trying to get two way data binding to work with a numeric stepper. It binds from value to display OK, but when I update the GUI the model value is not changed. How can I fix this?
<?xml version="1.0" encoding="utf-8"?>
[Bindable]
private var val:Number = 2;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:NumericStepper x="30" y="27" value="{val}"/>
<s:Button x="30" y="58" label="Apply" click="trace(val);"/>
To get two-way binding, you need a different syntax:
Notice the
@sign before the opening brace. Otherwise, it is just one-way