Taking the last example a little further, here I have added some animations to the generated balls. These balls are now increasing and decreasing in size while sitting at the same place. But the fun part is they are draggable too. Try it for your self and this is all running in HTML5 and flash both. Same code base.
The output for this example is here and the source code can be downloaded here.
Again this example uses haXe timer and its completely portable to all targets through NME.
Happy haXe -ing.