Processing.js blot onto entire webpage?
My friend has a Flash script that draws Pacman on top of his homepage. The bug is that the flash animation doesn't let him click on his page.
I'm trying to convince him to use P开发者_运维百科rocessing.js instead, but I'm not sure whether even Processing can blot on arbitrary parts of a webpage (e.g. by using a canvas the same size as the page but letting clicks through).
Processing-specific issue: Filling the canvas (e.g. background(white);
) obscures any HTML elements that might have displayed under the canvas.
Suggestions?
Just use two or three animated GIF's for the PACMAN image... and have javascript move a DIV with position: absolute; z-index: 10000;
across the page.
You can look into jQuery to ease up things.
I believe Flash either can't implement the mouse-trail or it is far more difficult than JS. See this tutorial : http://www.kirupa.com/developer/as3/dynamic_mouse_trail_flash_pg1.htm , where the mouse-trail demo is stuck in a box. I think because Flash is an all-or-nothing app. You can't truly mesh it in with the browser(i.e. Flash doesn't fully work with the DOM).
This is textbook JavaScript though.
See this page for more info on JS vs. ActionScript - http://positionabsolute.net/blog/2007/04/actionscript-vs-javascript.php
精彩评论