Flash mx 04 - swapDepth problem

Hi all,

I am having a slight problem with the following kirupa tutorial:
http://www.kirupa.com/developer/actionscript/swapdepth.htm

I’m trying to create a windows style interface which consists of 17 windows (not all showing at the same time).

by following the tutorial I have managed to get windows to jump to the top (z axis) when clicked on - no problems.
What i am experiencing though is that windows seem to interfere with each other.

For example i have windows a,b,c and d visible, with ‘a’ at the top, then ‘b’, then ‘c’ then ‘d’ at the bottom.

Lets say I click on ‘c’, it should jump to the top leaving the order c,a,b,d.

‘c’ does jump to the top but it brings ‘b’ with it making the order c,b,a,d.

I have checked all instance names etc and see no reason why ‘b’ should interfere with ‘c’. The more confusing thing is that it is not always ‘b’ that jumps with ‘a’ sometimes its ‘a’ or ‘d’. It seems to be random.
As I have 17 windows you can imagine how messy its all getting - arrgggghhh!

Not sure if my explanation makes enough sence - sorry.

Has anyone experienced this before?? Any help would be greatly appreciated before i smash my computer around the office.

Thanks