我正在尝试准备一个万用表。使用旋转代码我在我的舞台上移动针。然后当它达到一个值时,会显示一个显示。现在我有各种不同的电阻值。所以当我点击一个特定的电阻值时,它最初只显示电阻,当针旋转时,电阻和值应该一起显示。我尝试运行此代码,但收到错误 #1009:
import flash.events.MouseEvent;
stop();
Resistance.addEventListener(MouseEvent.MOUSE_DOWN, ResistanceMenu);
btn100Ohm.addEventListener(MouseEvent.CLICK, Ohm100Show);
function Ohm100Show(e:MouseEvent):void
{
gotoAndPlay(15);
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownOK);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpOK);
function ResistanceMenu(e:MouseEvent):void
{
gotoAndPlay(10);
}
function mouseDownOK (e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_MOVE, rotateOK);
}
function rotateOK (e:MouseEvent):void
{
var angle:Number = Math.atan2(mouseY - needle.y, mouseX - needle.x);
angle = angle * 180/Math.PI-90;
needle.rotation = angle;
Ohm_200.addEventListener(MouseEvent.MOUSE_OVER, Ohm_200Call);
function Ohm_200Call (e:MouseEvent):void
{
gotoAndPlay(20);
}
}
function mouseUpOK (e:MouseEvent):void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, rotateOK);
}
旋转部分运行正常。但是当我为 btn100Ohm 添加监听器时,我收到错误 #1009
请帮助我