In a normal world, this works as expected:
var array:Array = ['a','b','c'];
trace(array.indexOf(array[0]));
In a crazy world, this happens:
trace(Screen.screens.indexOf(Screen.screens[0]));
... if Screen.screensis Arrayavailable instances Screenwhy this array can not give an accurate indexOfone of their own children?
edit - To take another step, check this:
for each(var i:Screen in Screen.screens){
for each(var j:Screen in Screen.getScreensForRectangle(this.stage.nativeWindow.bounds)){
trace(i, j, i == j);
trace(i.bounds, j.bounds, i.bounds == j.bounds);
}
}
At least one Screenspecified in Screen.screensshould be identical Screento Screen.getScreensForRectangle(this.stage.nativeWindow.bounds)- but even if you compare Screen.bounds, it still does not match, despite two Rectangleobjects with the same size!
Madness, ladies and gentlemen! You don’t even want to see the workaround I collected (hint: it involves comparing the values Screen.bounds.toString()for the content Screen.screens)