跟随光标JavaScript的眼睛不起作用

时间:2018-09-04 00:19:21

标签: javascript animation adobe

我按照本教程https://www.youtube.com/watch?v=0ma6HNRP2aU在Adobe中制作了一个动画场景,其中眼睛跟随着鼠标光标。我更改了JS以添加第三只眼睛,因为我的场景涉及一只三只眼睛的怪物。存在语法错误,该错误使场景无法在Adobe Animate中进行动画处理,但是我不是编码人员,也不知道它是什么。没有代码,场景发布良好。也许你们可以发现错误?预先感谢您的帮助!

stage.addEventListener("mouseMove", arjun); 
function arjun(e:MouseEvent):void { 
    var var1 = mouseY - eyeR.y; 
    var var2 = mouseX - eyeR.x; 
    var radiusR = Math.atan2(var1,var2); 
    var degreeR = radiusR / (Math.PI / 180); 
    eyeR.rotation = degreeR; 

    var var3 = mouseY - eyeL.y; 
    var var4 = mouseX - eyeL.x; 
    var radiusR1 = Math.atan2(var3,var4); 
    var degreeR1 = radiusR1 / (Math.PI / 180); 
    eyeL.rotation = degreeR1;

    var var5 = mouseY - eyeT.y; 
    var var6 = mouseX - eyeT.x; 
    var radiusR2 = Math.atan2(var5,var6); 
    var degreeR2 = radiusR2 / (Math.PI / 180); 
    eyeT.rotation = degreeR2;
}

0 个答案:

没有答案