What does {variable} do in flex

I use {} around variables in MXML, not understanding what they are for. Now I need to know if I should use it around a variable .. what does it do?

example: <mx:label text="{variable}"/>

+3
source share
4 answers

This is a binding !,
In this case, it means that the contents of "variable" will be displayed in the label text; if you change the value of "variable", it will also change the text displayed by the label.

+8
source

As stated above, this will bind the variable to this object.

<mx:label text="{variable}"/>

variable , , variable , . , , , Bindable :

<mx:Script>
    ...
    [Bindable]
    private variable:String = "Label";
    ...
</mx:Script>
+5

{} . , [Bindable] :

[Bindable]
public var s:String;

.

, , ArrayCollection, , ArrayCollection IList ICollectionView, , , .

+3

As mentioned several times, this is really data binding. There is a good adobe article on using data bindings in flex .

+1
source

Source: https://habr.com/ru/post/1711177/


All Articles