最近开始学习Javascript,问题就在这里 当尝试通过外部 JS 脚本访问内部 Adobe Animate 库时,它会发誓并写入错误 如果我在 Adobe Animate 中编写此脚本,它可以正常工作,请帮忙
let myBlue = new lib.blueShape;
exportRoot.addChild(myBlue);
let xPosition = Math.floor(Math.random()*700);
let yPosition = Math.floor(Math.random()*700);
myBlue.x = xPosition;
myBlue.y = yPosition;
root.push(myBlue);
t抛出错误 - let myBlue = new lib.blueShape;
当使用 new 关键字时,您正在调用一个函数,该函数是对象的构造函数,因此您需要使用括号。
let myBlue = new lib.blueShape();