Assume I have an array with references to different display objects on the stage. The display objects do not have any other explicit references except for the array indexes. How do I evaluate if a certain index of the array is a reference to a certain display object?
Some code to clarify:
Assume:
objArr[1] = dispObj1;
objArr[2] = dispObj2;
objArr[3] = dispObj3;
function performSomeActionOnObj( ):void
{[INDENT] for( var i:int = 0; i < objArr.length; i ++)
{[INDENT]// problematic step
// how do I compare array index to display object
// when display object does not have an explicit
// reference within the display list?
if( [COLOR=Red]objArr[ i ] == dispObj2[/COLOR] [COLOR=Red]/???/[/COLOR] )
[/INDENT][/INDENT][INDENT][INDENT] {
[/INDENT][/INDENT][INDENT][INDENT][INDENT] dispObj2.foo( );
[/INDENT][/INDENT][/INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][INDENT][INDENT] else
[/INDENT][/INDENT][INDENT][INDENT] {
[/INDENT][/INDENT][INDENT][INDENT][INDENT] return;
[/INDENT][/INDENT][/INDENT][INDENT][INDENT] }
[/INDENT][/INDENT][INDENT] }
[/INDENT]}