Flash/AIR AS3: comparing contents of Screen.screens
Posted
by matt lohkamp
on Stack Overflow
See other posts from Stack Overflow
or by matt lohkamp
Published on 2010-03-30T01:24:56Z
Indexed on
2010/03/30
1:33 UTC
Read the original article
Hit count: 424
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?
© Stack Overflow or respective owner