Reputation: 269
If using {result} instead of {this.result}, the binding mechnism can't work. I didn't find any doc describing the thing. I am using Flex3.5. Do you know the reason?
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
<mx:Script>
<![CDATA[
[Bindable]
public var result:String ="b";
function confirm():void{
result = "changed text";
}
]]>
</mx:Script>
<mx:TextInput text="{this.result}"/>
<mx:Button label="Confirm" buttonDown="{confirm();}"/>
</mx:Panel>
Upvotes: 0
Views: 40
Reputation: 4684
This is not a problem of Binding. As far as I know, you should avoid using "result" as variable name, because it is used by components. If you rename result to result1, it will work perfectly regardless of the "this" keyword.
To see the difference between "result" and "this.result" you can try to define your "result" variable as static one. It will look like this:
So if there is uncertainty concerning some variable, "this" means that it is a member variable and not static one.
This expression can show you the difference between two variables as well:
<mx:TextInput text="{this.result === result}"/>
it returns false in your case.
Upvotes: 1