In animate CC, How do you target a root instance named object inside a function?
Have a html5 canvas document.
I have an object called "brick2" in the root of an animate CC scene (with the same instance name).
Code looks like this:
function moveBrick() {
this.brick2=0;
}
var timer1 = setInterval(moveBrick, 100);
this.stop();
When I run the file in a browser the brick doesn't go to "0" x position. However if I write this script (putting the x position property outside the function) it all works fine:
function moveBrick() {
}
var timer1 = setInterval(moveBrick, 100);
this.brick.x=0;
this.stop();
Any ideas on what I am doing wrong? Have a real worry that is something completely obvious.