原文(英語): How to make Flash Lite aware of softkey location and screen orientation
Flash Lite 1.1
Contents |
Nokia端末は複数の画面方向をサポートします。一部端末では、各画面方向を専用のソフトキーで提供します(N93, N95など)。
画面方向とソフトキーの位置は容易に変更することができます。
Flash Lite 1.1のゲームまたはアプリケーションを作成すると、画面方向とソフトキーを変更することができます。
fscommand2("GetSoftKeyLocation")コマンドで、現在のソフトキー位置を取得することができます。
キーリスナーの追加
// The screen orientation has changed by give an Insert key event.
On(KeyPress"<Insert>")
{
//Define a variable
lc=fscommand2("GetSoftKeyLocation")
}
変数lcは、下記の通り、ソフトキー位置を表す値を保持します。
// The screen orientation has changed by give an Insert key event.
On(keyPress"<Insert>")
{
//Define a variable
lc=fscommand2("GetSoftKeyLocation")
}
//when the device screen orientation changed the softkey location also changed.
if(lc==2){
tellTarget("txt_function"){
call("bottom")
}
} else if (lc==3){
tellTarget("txt_function"){
call("right")
}
}
端末実機ではコマンドをサポートします(N93, N95など)が、端末エミュレータではサポートしません。
例題のソースコードは、下記サイトからダウンロードできます。
No related wiki articles found