Today we are going to interact with some Canvas elements in HTML5. Previously I tried this with on ENTER_FRAME event and I think you know the rest of the story Thats my previous blog post is all about Finally I updated to code example to see haXe timer in action. The final version is here for the demo and the source code is here for you to download and play.
When the demo is open, it will create some random circles in Canvas. Now click on any circle to select it. It now sticks with mouse and once you click it again, it will stay in that position and stop coming the mouse. While in flash player the selected circle comes on top, even it was below another circle before selection, but in HTML5 version sometimes it works and sometimes not.
This is all same code base publishing to different targets. This particular code compiles successfully to flash, HTML5, Neko and iOS. I have tested in all targets, simply awesome.
Happy coding.