I have an EditBox on my layer.
var ebox = new cc.EditBox(cc.p(200, 30));
ebox.setPosition(size.width / 2 - 50, size.height / 2);
ebox.setPlaceHolder("Password");
ebox.setInputFlag(cc.EDITBOX_INPUT_FLAG_PASSWORD);
ebox.setDelegate(this);
ebox.setFontColor({"r": 0, "g": 0, "b": 0});
ebox.setFontSize(20);
ebox.initWithBackgroundColor(cc.size(200, 30), {"r": 0, "g": 255, "b": 0});
ebox.init();
this.addChild(ebox, 1); //this - is a main layer
then I have to display some kind of overlay over the main layer
this.getParent().addChild(overlayLayer, 100);
overlayLayer - layer filled with color
The thing is that editbox stays always above the overlay. Why isn't zOrder working with EditBox??
I get the same problem with your code. My solution is a workaround. You can use sprites as background. Then it works.