[ActionScript 3.0] 判断XML属性是否存在
在as3中判断xml节点是否存在以及判断xml某节点是否存在某属性可用下面方法:
1 if(xml.hasOwnProperty("frameRate")){ 2 trace("xml存在frameRate节点"); 3 } 4 if(xml.frameRate.@rate!=undefined){ 5 trace("xml的节点frameRate存在rate属性"); 6 }
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------