Accelerometer, AIR on Android and Tosia

Now it is fun. I did not realize that my handset has the accelerometer sensor until I saw the video. I didn’t even know that AIR for Android supports the thing. So I tried, and it worked! I modified the code from previous posts, removing multitouch events and adding simple AccelerometerEvent. This seems quite straightforward, and the only thing I still do not get is why it is called accelerometer while it aparently measures axis tilt, not acceleration.

Runtime check if the hardware supports us:

			if (Accelerometer.isSupported) 
			{ 
				accl = new Accelerometer(); 
				accl.setRequestedUpdateInterval(200); 
				accl.addEventListener(AccelerometerEvent.UPDATE, handleAccelerometer); 
			} else{
				tf.appendText('\naccelerometer NOT supported');
			}

And the actual handler:

		private function handleAccelerometer(e:AccelerometerEvent):void
		{
			var n:int = sprites.length;
			var s:Handle;
 
			// loop through all alive sprites to update their speed
			for(var i:int = 0; i < n ;  i++){
				s = sprites[i];
				s.speedX -= e.accelerationX * 10;
				s.speedY += e.accelerationY * 10;
			}
		}
 
        // this exits the app on any key (event volume up/down!)
		private function handleKey(e:KeyboardEvent):void
		{
			NativeApplication.nativeApplication.exit();
 
		}

kurs EUR w PayPal

Wypłaciłem dziś niewielką kwotę z PayPal. Ponieważ system pracuje w euro, a moje konto niekoniecznie, nastąpiło przeliczenie po kursie. No i tu niespodzianka:
Kurs wymiany: 1 Euro = 3,86084 Złote polskie
Podczas gdy waluty.onet.pl mówią:
USD/PLN Kurs bieżący kupna bid (PLN): 3,9620 Kurs bieżący sprzedaży ask (PLN): 3,9680
Podobną sytuację, tylko w przeciwną stronę opisują na forum money.pl

hm.

playing AIR on Android

Keeping on with the simplest stuff and having innocent fun with touching a device :)

« Previous PageNext Page »