Flash/AIR AS3: comparing contents of Screen.screens
- by matt lohkamp
In a sane world, this works as expected:
var array:Array = ['a','b','c];
trace(array.indexOf(array[0])); // returns 0
In an insane world, this happens:
trace(Screen.screens.indexOf(Screen.screens[0])); // returns -1
... if Screen.screens is an Array of the available instances of Screen, why can't that array give an accurate indexOf one of its own children?
edit - apparently to get back to the world of the sane, all you have to do is this:
var array:Array = Screen.screens;
trace(array.indexOf(array[0])); // returns 0
Anyone know why?