I need help with JavaScript in Adobe AnimateCC:
I have two different movie clips and a button. I would like to be able to click on a movie clip (making it the currentTarget) and then click on a button which calls the currentTarget (the just-clicked-on movie clip) and makes it do something -- move 500 px along x for example. Here's my code so far. Any help will be greatly appreciated.
this.grayPentagon_1_mc.addEventListener("click", clickSomePentagon.bind(this));
this.grayPentagon_2_mc.addEventListener("click", clickSomePentagon.bind(this));
function clickSomePentagon(e)
{
alert(e.currentTarget);
var myPentagon = e.currentTarget;
}
this.red_btn_1.addEventListener("click", makeSomePentagonMove.bind(this));
function makeSomePentagonMove()
{
alert("move my pentagon");
myPentagon.x = 500;
}