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