• Click here for a list of all my projects.
  • Click here for Touchlib info. Source code here.
  • Click here for our multitouch community site.

Monday, February 25, 2008

Touchlib svn updates


I added a new Flash application to touchlib. It's a game called Pegs and it uses the great Box2d physics engine. There's really nothing about it that leverages the fact that it's multitouch, but it's fun. I think Box2d could be a nice platform for writing simple games. Check out Pegs for examples on how to do basic things like collision detection and using Sprites in place of the simple wireframes. The PhysicsCanvas class should be your basis for multitouchable physics apps. I will be adding additional features to it as needed. For now, you can override it's methods to get a working physics system with very little work.
I also added a basic demo of Box2d physics with touchlib support. You can grab and manipulate multiple shapes at once. Nui (chris moore) is reportedly working on an update to that with the rest of the Box2d demos. It's called Phys1 in the AS3\src directory. Code is in AS3\app\demos\Phys\, if my memory serves me.

Labels: ,

Saturday, November 03, 2007

Garbage Collection in Flash AS3


I'm blogging about this because it's one area which can be potentially troublesome for people who are switching from the AS2 style of doing things to AS3. One of the big differences about AS3 is the fact that programmers have more control over the heirarchy of Display objects (formerly MovieClips). It's easier now to traverse the list of children of a display object. You can also take a display object from one parent and move it to another. In AS2, removing a Movieclip was a way to delete it. Not so in AS3. I've been running into some issues when using the Loader object. Removing the loader and calling unload on it was not enough to delete the contents of the loader. I could tell because the clips were still playing sounds even though they weren't on the stage. One reason these clips weren't getting deleted is because having an object listen for events creates a reference which will keep that object from being deleted. To help with this situation, adobe has allowed us to hook events with Weak references. Weak references are not counted as a reference, so if only weak references remain, an object should be garbage collected.


Even with weak references, it seems to be a best practice to remove all event listeners when an object is no longer needed. Because of this, I think flash needs deconstructors. There should be a way to signal that an object should be deleted and allow programmers to write code that can clean up that object's resources. Also, it would be nice to have some control over when garbage collection occurs.

Labels: , ,

Tuesday, October 23, 2007

Flash: Most annoying combination of keys to accidently press

Control-Shift-W. It locks your workspace to the current movie size (meaning you can't scroll outside the bounds of the movie). This usually causes your workspace scrollbars to disappear as well. I've had to close what I was working on once because I couldn't figure out what I had pressed to get into this mode. This keyboard shortcut also seems to be missing from most 'Flash shortcut' guides and it's fairly hidden on the menu bar as well. Hopefully this blog post will save others from a similar fate.

Labels:

Friday, August 31, 2007

Adobe AIR extensions for CS3

Kudos to Adobe for releasing some extensions for CS3 to produce .AIR files right from within the IDE. This greatly simplifies the process of creating AIR files (before you had to jump through a number of hoops such as installing the Flex SDK, etc..). For those that don't know, AIR is adobe's solution for doing desktop apps/widgets, similar to the Java runtime.

In relation to Touchlib, I think packaging the multitouch flash apps as an .AIR file is the way to go. AIR also has a very nice built in ability to display fully browsable web pages, making a multitouch browser in flash possible.. I suspect Adobe will also be adding some other powerful features to AIR which could help make it attractive for developing simple, graphical desktop apps.

Labels: , ,

Tuesday, March 13, 2007

Touchscreen work


I just received a new PC I ordered. I'm planning on dedicating it to my multitouch table so that I can have a more permanent setup. So, right now I'm doing the fun task of getting all the windows updates installed. I'm also planning on messing a bit with Ubuntu later this week.
Lately I've been doing some work on creating some Actionscript 3 classes for Flash 9 that will interface with FLOsc. The nice thing about what I'm doing is that my TUIO events will extend the regular mouse events, so regular components (such as buttons, scrollbars, etc) may still work in a multitouch setting.

Overall I'm really liking most of the changes for Actionscript 3, especially the XML ones which make dealing with XML a much more painless process. Also, the extra speed and lower level control over movieclips and bitmaps is nice. I'm looking forward to seeing what kind of graphical effects I'll be able to accomplish.

Once I get these classes done I'll be working on some small multitouch apps (preferably games or other fun things) in Flash 9. I want to make a game that a couple people can work together on in a cooperative way. I think sandbox style games may work well.
If anyone has any ideas they'd care to share, feel free to post them in the comments.

Labels: ,