Escaping for loop?

I’m using Kirupa’s “search array” to check wether something is loaded.

It “works” however it doesn’t stop if daft = 1, so it keeps checking and gives its final answer as 0

if I can’t escape from the for loop

I don’t know

 for (i=0; i<pressArray.length; i++) {
  trace("array"+i+" "+pressArray*);
  if (pressArray* == pos) {
   daft = 1;
   //delete for
   /// exit for loop
   //return -1
  } else {
   daft = 0;
  }
 }

thanks