ma9_7.swf |
ActionScript2.0(Flash Lite2.0)
this.onEnterFrame = function() { //バッテリーレベル 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; batteryPict.gotoAndStop(batteryStatusNum + 1); stop(); _global.BSN = 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; antennaPict.gotoAndStop(signalNum + 1); stop(); _global.SN = 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; } }; topButton.onRelease = function() { fortuneArray = ["大吉", "大吉", "吉", "半吉", "小吉", "末小吉", "末吉", "凶", "凶", "凶", "凶", "凶"]; fortuneNum = Math.floor(Math.random()*(_global.BSN+_global.SN)); fortuneStr.text = "あなたの運勢は、"+fortuneArray[fortuneNum]+"("+fortuneNum+")です"; fortunePict.gotoAndStop(fortuneNum + 1); stop(); };
0 件のコメント:
コメントを投稿