Fun with Flash
I have always found Flash to be a wonderful platform for experimenting with ideas. I used to use javascript earlier, but there if you had to do anything with UI, you had to do some tricky HTML DOM manipulation or use a package like Dojo. Over the past few days I (re)discovered Flash to be a great tool which can come in handy sometimes. With ActionScript 2.0, there is also a pretty rich OO language for creating fairly complex programs (people have written 3D engines in Flash!). I enjoyed tinkering and in the process picked up a little bit of ActionScript 2.0, Math, and Physics concepts!Here is a small sampling of programs I wrote:
- Bounce.swf - simulates some basic forces of gravitation/drag on a ball. You can click and release the ball to give it some speed. The ball bounces around inside a box until it comes to a stop (due to all those forces acting on it).
- Tentacles.swf - uses some basic trigonometry and the 2D drawing API of Flash. It simulates an organism which is hyper-active and has some tentacles. You can click to move it. It also tracks your mouse movements. When you click on a new location, the movement has an easing-in effect. The tentacles are beziers with one control point.