Function to search an array
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
}
function findMatchingIndex(aTitles:Array,
sTitle:String):Number
{
for(var i:Number = 0; i < aTitles.length; i++) {
if(aTitles[i] == sTitle) {
return i;
}
}
return null;
}
}
}
Related examples in the same category