<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private var str:String = null;
private var o:Object = "123";
private function init():void {
//因为str是空所以条件不成立
if(str) {
Alert.show(str.toString());
}
//因为o不为空所以条件成立
if(o) {
Alert.show(o.toString());
}
}
]]>
</mx:Script>
</mx:Application>
flex的条件判断:存在即为true
最新推荐文章于 2020-05-08 17:53:53 发布