"In Flex, a method can also be used as a Data Binding data source, provided that the parameters of the method must be declared as binding property variables. When the variable changes, the bound method is automatically called ". I am a little confused when I see this sentence, so I will test it myself.
<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute"> <br/> <mx: SCRIPT> <br/> <! -- [CDATA [<br/> private function go (value: string): String {<br/> return value; <br/>}< br/>] --> <br/> </MX: SCRIPT> <br/> <mx: Form> <br/> <mx: formitem label = "Data source:"> <br/> <mx: textinput id = "txtsrc"/> <br/> </MX: formitem> <br/> <mx: formitem label = "target data:"> <br/> <mx: textinput id = "txtdest" text = "{go (txtsrc. text)} "/> <br/> </MX: formitem> <br/> </MX: Form> <br/> </MX: Application>
If you enter the text above, the same text will be output below. Does it mean that the parameter must be declared as an attribute variable that can be bound? So that we can know ~ In the past, the attributes of Components in flex were already Bindable [Bindable], so it was no wonder that they could be updated in time.