You might want to check out the example I have up at
http://www.figleaf.com/development/flash5/

If you mess with yours for a bit you see that you have some funky redraw problems. Mine adjusts this by "bubbling" the selected window to the top rather than directly swapping it up.