Search Flex Components Free

Custom Search

December 7, 2007

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:
PLAIN TEXT
XML:

It seems like the logical operator works just fine though, for example:
PLAIN TEXT
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:
PLAIN TEXT
XML:

2: Probably easier
You can & rather than &

Related Flex Tutorials