Posts tonen met het label osx. Alle posts tonen
Posts tonen met het label osx. Alle posts tonen

zondag, maart 11, 2007

The Apple Sudden Motion Sensor (SMS) to Flash

Not only the keyboard of my MacBook lits up in the dark, it seems to be equiped with a Sudden Motion Sensor or SMS.
This motion sensor is designed to protect your hard disk when the computer is dropped or undergoes severe vibration.

The Sudden Motion Sensor is designed to detect unusually strong vibrations, sudden changes in position or accelerated movement. If the computer is dropped, the Sudden Motion Sensor instantly parks the hard drive heads to help reduce the risk of damage to the hard drive on impact.

Ofcourse the sensor can be used for more vital applications as well. How about a game of Pong anyone? It has been done in Processing, so why not give it a try in Flash. Just for the sake of it!

Here is an example I've build using Java and Flash.



I know the ball is going at 'loser' speed, but hey it's MY party and I cry if I want to!
Download the source code here:

http://www.seeingisbelieving.be/blog/AppleSMS2Flash.zip

Included are the Unimotion library and the Java API to work with it, the Flash files and the Java socket server.
The big picture is you use the Unimotion library in Java for detecting the motion and then send it to the Flash through a Java socket server.

Related links:
Lincoln Ramsey (created Unimotion library)
Daniel Shiffman (created the Java API for Unimotion)
Grant Skinner (for the Flash collision detection)
Info about the SMS

vrijdag, januari 26, 2007

Compile AS3 on OSX without FlexBuilder

A glorieus moment in time...

After 10 years it finally happend, I got myself a Mac.

I have always been very happy with my pc and spreaded the message that Mac's were used by girls or the more girlie type kinda guys...

Well now I have one myself. So yeah I am in touch with my feminin side!



I have to say that I enjoy working on this machine more and more. The keyboard lights up in the dark! How funky is that? That is actually the main reason why I got it really.

So one of the first things I had to do was setting up my development environment.
That includes playing around with AS3 yeah!

So here's a litle 'howto' on compiling AS3 on the Mac. Flexbuilder is a much more complete solution (codehinting, debugging, ...) but is not free and Flashdevelop which is great does not support Mac.

So I am using Eclipse, Ant and the Flex2 SDK.

You can download the tutorial and project files here: (project files are included)
www.seeingisbelieving.be/blog/as3onosx.zip

Thanks to Steve Nelson from BFPUG for setting up the project templates.