事件起因:“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和;间加了个空格)
嗯,空闲时间读读文档丰富知识还是非常必要的~~

@mousebomb:
呵呵,你BLOG上的AIR部分写得很不错啊
[Reply]
这个细节很重要,多谢分享
[Reply]