Simple-ish question

Hello all i have a question that despite the topic may of may not be as simple as i original thought. anyway the question is as follows

how do i get the index of a window's elements?

 the reason i need this is because id like to use the index as flags for triggering windows to hide or show.

i really need help with this. 
Depends on where you want the index data. 

If you want the index inside of the window code then call this.index();

If you want the window index during a scene code then call this.wateverWindow._index;
thanks coldfire i'll try it now.
it works thnks a bunch. 

Original thread: https://forums.rpgmakerweb.com/threads/simple-ish-question.53255/