flash as3.0 键盘事件问题
stage.addEventListener(KeyboardEvent.KEY_DOWN,onyydown);functiononyydown(event:Keyboa...
stage.addEventListener(KeyboardEvent.KEY_DOWN, onyydown);
function onyydown(event:KeyboardEvent):void{
switch(event.keyCode){
case Keyboard.LEFT:
yy.width -= 60;
case Keyboard.RIGHT:
yy.width += 60;
break
}
}
场景中有个叫YY的矩形 ,以上代码 按right 矩形向右边加长,按left没反应,求解。 展开
function onyydown(event:KeyboardEvent):void{
switch(event.keyCode){
case Keyboard.LEFT:
yy.width -= 60;
case Keyboard.RIGHT:
yy.width += 60;
break
}
}
场景中有个叫YY的矩形 ,以上代码 按right 矩形向右边加长,按left没反应,求解。 展开
2个回答
展开全部
stage.addEventListener(KeyboardEvent.KEY_DOWN, onyydown);
function onyydown(event:KeyboardEvent):void
{
switch(event.keyCode)
{
case Keyboard.LEFT:
yy.width -= 60;
break;
case Keyboard.RIGHT:
yy.width += 60;
break;
}
}
function onyydown(event:KeyboardEvent):void
{
switch(event.keyCode)
{
case Keyboard.LEFT:
yy.width -= 60;
break;
case Keyboard.RIGHT:
yy.width += 60;
break;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询