Question
Movieclip in canvas throws error when I try to target it.
I have a movieclip that I made on the timeline (a blue square) which I have given the instance name of "blueSquare".
The following code works:
this.blueSquare.x = 800;
But when I try to put that in a function, it throws an error saying blueSquare is undefined:
function moveMe() {
this.blueSquare.x = 800;
}
moveMe();This also is undefined:
function moveMe() {
blueSquare.x = 800;
}
moveMe();I've tried calling my square 'stage.blueSquare', 'stage.canvas.blueSquare', and others.
Any idea why this doesn't work?
