Actionscript 3 Search for string in array, propblem -
i have problem searching strings in array. want search 1 word , if exists, want trace position of string in array.
i believe should this:
if (myarray contains "11111111") { trace("*position*") } else { trace("cant find it"); }
what kind of syntax using there , have checked documentation of array
class? should first thing check always, there pretty straightforward method it:
var arr:array = ["1111", "2222", "3333"]; trace(arr.indexof("3333")); //traces index: 2
Comments
Post a Comment