A conflict exists with inherited definition
An error pops up when im using this code to move a character in one of my games. Im using actionscript and im not sure if this coding is for HTML so it doesn't work. I'm extremely new to coding and your help is very much needed.
"A conflict exists with inherited definition flash.display:DisplayObject.root in namespace public."
var root = this;
document.addEventListener("keydown", handleKeyDown);
function handleKeyDown(event) {
//left and right arrow key
if (event.which == 37 || event.which == 39) {
var newX = root.characterGame.x + (10 * (event.which - 38));
createjs.Tween.get(root.characterGame).to({x: newX}, 1);
}
//up and down arrow key
if (event.which == 38 || event.which == 40) {
var newY = root.characterGame.y + (10 * (event.which - 39));
createjs.Tween.get(root.characterGame).to({y: newY}, 1);
}
}
