Use Array.indexOf on Flash to avoid memory leaks.