xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:mx=”library://ns.adobe.com/flex/mx”
width=”100%” height=”100%” creationComplete=”creationHandler(event)”>
import mx.events.FlexEvent;
protected function creationHandler(event:FlexEvent):void
{
var array:Array=[“桃树”,”梨树”,”松树”,”樟树”];
if(array.indexOf(“梨树”) !=-1)
{
trace(“按索引从小到大查:”+array.indexOf(“梨树”));
}
if(array.indexOf(“樟树”,3) !=-1)
{
trace(“从第三个元素开始,按索引从小到大查:”+array.indexOf(“樟树”,3));
}
}
]]>
© 版权声明
文章版权归作者所有,未经允许请勿转载。