We often encounter this situation when developing:
a.swf is added to the web page, a.swf and html pages have scroll bars at the same time, and the project manager raised a BT requirement---process a. When the swf mouse is scrolled, the html page does not scroll. Otherwise, the html page scrolls!
What should be done?
Method 1:
1. Move the mouse into a.swf to scroll area: Tell JS to remove the browser mouse scrolling monitor.
2. When the mouse moves out of the a.swf scrolling area: Tell JS to add the browser mouse scrolling monitor.
3. The wmode of a.swf is set to "window".
Summary: Setting wmode to "window" may not meet the project requirements, which makes a.swf block any html page below it; in addition, press Alt Tab after moving the mouse into the a.swf scroll area When switching pages, JS is not notified to add browser mouse scroll monitoring, so there is no scroll processing when switching back to the html page after the operation
Method 2:
1.a. swf cancels its own mouse scrolling listening event, and adds a scrolling processing interface for JS to call, such as wheelToFlash(value).
2. When the mouse moves into the a.swf scrolling area: inform JS, for example, mouseIsInFlashWheelRange=true.
3 .When the mouse moves out of the a.swf scrolling area: inform JS, for example, mouseIsInFlashWheelRange=false;
4.JS listens to mouse scrolling events. In the event listening processing function, we need to make the following judgments
Javascript code: