Animate (Canvas HTML5) Bring Movieclip to front by clicking on a Button
Hello all, I am fairly new to Animate 2020 and have a little project in HTML5/Canvas with a few buttons on a stage. It's like a computer desktop with some icons to click on. Each button displays a movieclip (the "windows" on the desktop) when it's clicked. Like with a real computer desktop, the window which is opening when the button is clicked should be in the very front.
I found this Javascript which worked quite nicely, but only brings then button itself (instance name is "myButton") to the front:
this.bringToFront = function(e){
e.currentTarget.parent.addChild(e.currentTarget);
};
this.myButton.on("mousedown", this.bringToFront);
I tried this, with "myMC" being the Movieclip which I actually want to bring to the front, but that didn't work:
this.myButton.on("mousedown", this.myMC.bringToFront);
Can anyone help? Thanks a lot!!!
