This has an example taken from the crafty.js site