Stacked images come to front if you hover over them
I have an animate project with three rectangles that are movie clips. The three are stacked on top of one another but are offset so you could hover over each one. What I want is for the the rectangle I'm hovering over to come to the top. I created it using the setChildIndex using createJS, but it isn't working. Please help!
var frequency = 15;
stage.enableMouseOver(frequency);
this.blueBox.addEventListener("mouseover", mouse1.bind(this));
function mouse1()
{
this.setChildIndex(this.blueBox,2);
alert("blueBox");
}
stage.enableMouseOver(frequency);
this.redBox.addEventListener("mouseover", mouse2.bind(this));
function mouse2()
{
this.setChildIndex(this.redBox,2);
alert("redBox");
}
stage.enableMouseOver(frequency);
this.greenBox.addEventListener("mouseover", mouse3.bind(this));
function mouse3()
{
this.setChildIndex(this.greenBox,2);
alert("greenBox");
}
