Description of binding methods in flex

Source: Internet
Author: User

"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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.