Using “Some “ActionScript expressions in curly braces - Data Binding

I seem to have come accross a little problem with the Logical Operator “&&” and Data Binding in MXML. It seems the MXML in Flex Builder doesn’t like the & character. Therefore, you get the following error when trying to bind an expression using the “&&” operator:

“The entity name must immediately follow the ‘&’ in the entity reference.”

An example of when this would be used would be if you are trying to bind the enabled property of a button:

[xml]

[/xml]

Therefore, you have two options as a solution

1:

You have to go back to De Morgan’s laws
(A && B) == ! (!A || !B)

Therefore, i can fix the first expression like so:

[xml]

[/xml]

Now you should be good to go.

Leave a Reply