用FLASH编程序,遇到“1120: 访问的属性 hs1 未定义。”,请问是什么原因,我在下面将这段代码附上

2024-12-12 22:05:55
推荐回答(2个)
回答1:

改成这样就好:
fk1_mc.addEventListener(MouseEvent.MOUSE_DOWN,zt1fk1);
function zt1fk1(event:MouseEvent)
{
fk1_mc.startDrag();
this.stage.addEventListener(KeyboardEvent.KEY_DOWN,hs1);
}
function hs1(event:KeyboardEvent)
{
switch (event.keyCode)
{
case 65 :
fk1_mc.rotation-=3;
break;
case 68 :
fk1_mc.rotation+=3;
break;
case 87 :
fk1_mc.scaleX+=0.2;
fk1_mc.scaleY+=0.2;
break;
case 83 :
fk1_mc.scaleX-=0.2;
fk1_mc.scaleY-=0.2;
break;
}
}

fk1_mc.addEventListener(MouseEvent.MOUSE_UP,zt2fk1);
function zt2fk1(event:MouseEvent)
{
fk1_mc.stopDrag();
this.stage.removeEventListener(KeyboardEvent.KEY_DOWN,hs1);
}
fk1_mc.buttonMode=true;

回答2:

深奥