Device Shake – Accelerometer

Here you have an easy way to detect shakes on mobile devices with equipped accelerometer:

var lastShake:Number = 0;
var shakeWait:Number = 600;
 
var acc:Accelerometer = new Accelerometer();
acc.addEventListener(AccelerometerEvent.UPDATE, onAccUpdate);
 
function onAccUpdate(e:AccelerometerEvent):void
{
	if(getTimer() - lastShake > shakeWait && 
			(e.accelerationX >= 1.5 
			|| e.accelerationY >= 1.5 
			|| e.accelerationZ >= 1.5))
	{
		shakeIt();
		lastShake = getTimer();
	}
}
 
function shakeIt()
{
	trace("device has been shaked");
}

Enjoy!

First encounter with AIR for Android

Today I made some experiments with AIR for Android. The process was very smooth and I like how simple everything is, in just a few minutes I managed to compile an application and play with it on my Android device. Totally love the way that I can reuse the ActionScript 3 code and make beautiful applications for Android!

Not so many good words about the Android Market. I started an account, then I was asked to pay a fee of $25 and then when my account was created I noticed that I can’t really make paid applications for the Android market since Google Checkout is not available in Romania. How messed up is that? You want people to develop applications for your marketplace, you request a fee and then they have no way to at least get some of that money back. It’s not that I can’t live without 25 bucks, but that really sucks, I feel like I’m giving them money so I can develop for their marketplace and help it grow a little more (so they can earn even more money). I love Flash related technologies and Android, but this doesn’t have any logic.

Anyway, I tried to implement an older youtube player into my AIR application so I can test it out and see how it works. The problem was that when I played a video and hit the hardware back button on my device, the video was still playing because the application minimized instead of closing (as I imagined it would). Then I started to search for a solution, and sure enough, I found it very fast on Tom Krcha’s blog. To close the button when you hit the back button you first need to register a handler:

if(Capabilities.cpuArchitecture=="ARM")
{
	NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, handleKeys);
}

Then you need to make the function for that handler:

function handleKeys(event:KeyboardEvent):void
{
	if(event.keyCode == Keyboard.BACK)
	NativeApplication.nativeApplication.exit();
}

That’s it. I will continue to work with AIR for Android and hopefully make some cool apps 🙂

This is amazing! 3D Flash Game with P2P Multiplayer

I have to say, a Multiplayer 3D Game running in Flash Player is really exciting!
The future of gaming will change from now on. Take a look and tell me what you think 😉

Interesting videos from MAX 2010

I have found some very interesting videos from MAX 2010 and I want to share them with you, I believe you’ll love the new stuff as I do! 😀

Video Tapestries:

Read more
Now you know what I did last summer. Bonus: what I’m working on

It’s been a long time since my last blog post. In the past few months, had time for a little vacation (I went to Anonimul Film Festival) and I worked on some very interesting projects.

Lately, I’ve started working on some projects with Biro Barna (a friend of mine and a highly trained ActionScript developer).

Moreover, I’ve started working with Flash Builder where I code my projects and Flash IDE to compile them. I’m starting to like this work flow, it’s more organized and I feel like I can code faster this way 😀

In addition to all this, I’m working on a custom DailyMotion player and I’m using the official API.

The problem right now is that I can’t get the chromeless player to work, I believe it’s a problem with this API or something, I will be doing some more research and see what can be done to fix this problem.

I’ll let you know when or if this project will be done.

Shuffle text menu

This is text shuffle class that will help you make a nice flash menu for your site or your applications. I got inspired from a similar class made by Lee Brimelow. You can use it for open source or commercial projects (do anything you want).

Get Adobe Flash player

  Shuffle Text (20.8 KiB, 2,186 hits)