Depths behaving strangely

I’m working on a major project and have found that the depths are behaving strangely when I introduce a ComboBox. I have removed about 1000 lines of AS and changed some things slightly to show exactly what is happening.

Here is the reduced code:
[AS]//the line below works:
//_root.createEmptyMovieClip(“myMenu_mc”,1);
//but this line doesn’t:
_root.createEmptyMovieClip(“myMenu_mc”,_root.getNextHighestDepth());

myMenu_mc._x = 65;
myMenu_mc._y = 395

myMenu_mc.buttonFormat_tf = new TextFormat();
myMenu_mc.buttonFormat_tf.bold = true;
myMenu_mc.buttonFormat_tf.size = 12;
myMenu_mc.buttonFormat_tf.align = “center”;
myMenu_mc.buttonFormat_tf.font = “Arial”;

myMenu_mc.createEmptyMovieClip(“submit_mc”,myMenu_mc.getNextHighestDepth());
myMenu_mc.submit_mc._x = 0;
myMenu_mc.submit_mc._y = 35;
myMenu_mc.submit_mc.createTextField(“submit_txt”,myMenu_mc.submit_mc.getNextHighestDepth(),0,0,50,40);
myMenu_mc.submit_mc.submit_txt.text = “Submit”;
myMenu_mc.submit_mc.submit_txt.border = true;
myMenu_mc.submit_mc.submit_txt.background = true;
myMenu_mc.submit_mc.submit_txt.backgroundColor = 0x0000FF;
myMenu_mc.submit_mc.submit_txt.setTextFormat(myMenu_mc.buttonFormat_tf);

myMenu_mc.submit_mc.onRelease = function () {
//do something
}

myMenu_mc.createEmptyMovieClip(“reset_mc”,myMenu_mc.getNextHighestDepth());
myMenu_mc.reset_mc._x = 60;
myMenu_mc.reset_mc._y = 50;
myMenu_mc.reset_mc.createTextField(“reset_txt”,myMenu_mc.reset_mc.getNextHighestDepth(),0,0,50,40);
myMenu_mc.reset_mc.reset_txt.text = “Reset”;
myMenu_mc.reset_mc.reset_txt.border = true;
myMenu_mc.reset_mc.reset_txt.setTextFormat(myMenu_mc.buttonFormat_tf);

myMenu_mc.reset_mc.onRelease = function () {
//do something
}

import mx.controls.ComboBox;
createClassObject(ComboBox, “dirChoice_cb”, _root.getNextHighestDepth());
dirChoice_cb.addItem(“bigger”);
dirChoice_cb.addItem(“smaller”);
dirChoice_cb.addItem(“same”);
dirChoice_cb.setEditable(false);
dirChoice_cb._x = 75;
dirChoice_cb._y = 415;

_root.createEmptyMovieClip(“box_mc”,_root.getNextHighestDepth());
box_mc.lineStyle(1, 0x666666, 100);
box_mc.beginFill(0xeeeeee, 100);
box_mc.moveTo(135, 470);
box_mc.lineTo(675, 470);
box_mc.lineTo(675, 650);
box_mc.lineTo(135, 650);
box_mc.lineTo(135, 470);
box_mc.endFill(); [/AS]

I’ve attached a zipped SWF to demonstrate. The ComboBox is above the “Submit” button, as would be expected, but the items in the drop-down appear BEHIND the button. Very strange! If you uncomment the 2nd line and comment the 4th line, you’ll see it behaves as expected. (Don’t forget to put a ComboBox in the library and link it or you won’t see any ComboBox.)

You may say, “he’s found the solution so what’s the problem?” Well, the problem is that there are over 1000 lines of AS code and I’d rather not have to “randomly” set the depth of the myMenu_mc movieclip when getNextHighestDepth() SHOULD work.

Any ideas what’s going on here?