suppose a small app which connects to server and displays some data. The problem is that when MOUSE_WHEEL is thr开发者_高级运维own the page is scrolling. How is it possible to disable page scrolling on MOUSE_WHEEL from flash? Please do not advice solution on JS side, users place our ccin their blogs/cites so we cannot force them to add any JS.
Thank you in advance!
It's not possible to block it with pure AS3. Your only option is to inject JS into the document via ExternalInterface
. This won't require your users to add anything to their page beyond the SWF embed code; it just requires your embed code to include allowScriptAccess
as sameDomain
or all
. Here's an example utility that enables this:
http://www.spikything.com/blog/index.php/2009/11/27/stop-simultaneous-flash-browser-scrolling/
Here, I created a small lib which works on all kind of flash plugins (including chrome Pepper flash) and MAC-OS
It consists of one AS3 file and you won't need to add anything to your site (html) directory
GIThub Repo
精彩评论