MXML标签中 逻辑与 的书写

事件起因:“Logical AND” with flex binding in mxml
这种情况以前也碰到过,我也很是奇怪为什么不能直接用”&&”,当时着急解决,就写了个外部方法来处理了。后来竟然把这事忘记了。
看到上面那篇文章后查了下帮助文档(关键词:logical and binding)
发现帮助文档里已经写明了:
Using an ampersand character in a data binding expression
Because of the parsing rules of XML, if you want to use an ampersand character, &, in a data binding expression in an MXML file, you must replace it with the hexadecimal equivalent character, &. For example, if you want to use a logical or expression, written in ActionScript as &&, then you have to write is as & a m p;& a m p;, as the following example shows:

(注:防止转码,只好在& a m p和;间加了个空格)
嗯,空闲时间读读文档丰富知识还是非常必要的~~

2 comments to MXML标签中 逻辑与 的书写

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">