手機操作最常使用的便是左右軟鍵、方向鍵,以下是很簡單的key control寫法fscommand2("SetSoftKeys", "Left", "Right");
var keyListener:Object=new Object();
keyListener.onKeyDown=function(){
var code=Key.getCode();
if(code==ExtendedKey.SOFT1){
//left soft key
}else if(code==ExtendedKey.SOFT2){
//right soft key
}else if(code==37){
//left
}else if(code==39){
//right
}else if(code==38){
//up
}else if(code==40){
//down
}else if(code==13){
//enter
}
}
Key.addListener(keyListener);
This comment has been removed by a blog administrator.
ReplyDelete