ma13debug.swf |
ActionScript2.0(Flash Lite2.0)
this.onEnterFrame = function() { //debug用 SharedObject利用可否チェック var checkSharedObject = "none"; checkSharedObject = System.capabilities.hasSharedObjects; checkSharedObjectStr.text = checkSharedObject; //debug用 キャリア判定 maxBatteryTemp = fscommand2("GetMaxBatteryLevel"); var carrier = "other"; if (maxBatteryTemp == 3) { carrier = "au/softbank"; } else if (maxBatteryTemp == 100) { carrier = "docomo"; } else { carrier = "other"; } carrierStr.text = carrier; //バッテリーレベル var batteryCharging = fscommand2("GetPowerSource"); var batteryLevel = fscommand2("GetBatteryLevel"); var maxBattery = fscommand2("GetMaxBatteryLevel"); var batteryStatusNum = 0; if (batteryCharging) { batteryStatusNum = 10; } else { if (maxBattery == 3) { batteryStatusNum = batteryLevel; } else if (maxBattery == 100) { if (batteryLevel>80) { batteryStatusNum = 8; } else if (batteryLevel>60) { batteryStatusNum = 7; } else if (batteryLevel>40) { batteryStatusNum = 6; } else if (batteryLevel>20) { batteryStatusNum = 5; } else if (batteryLevel>0) { batteryStatusNum = 4; } } } batteryStatusNumStr.text = batteryStatusNum; //受信レベル var signalLevel = fscommand2("GetSignalLevel"); var maxSignal = fscommand2("GetMaxSignalLevel"); var signalNum = 0; if (maxSignal == 4) { signalNum = signalLevel; } else if (maxSignal == 3) { if (signalLevel>0) { signalNum = signalLevel+1; } } signalNumStr.text = signalNum; //開閉回数 var mySharedObject:SharedObject = SharedObject.getLocal("open"); SharedObject.addListener("open", initHandler); mySharedObject.data.count = 0; mySharedObject.flush(); function initHandler() { var date:Number = Number(mySharedObject.data.count); date++; mySharedObject.data.count = date; mySharedObject.flush(); checkNumStr.text = mySharedObject.data.count; } };
※PC上で動作確認を行う際は,iモードHTMLシミュレータⅡを使用すると便利です.
0 件のコメント:
コメントを投稿