Is it possible to disable mousewheel scrolling on my webpage while the cursor is over my flex application?
My flex application is a map that allows user to zoom in and out using the mousewheel; however, when I put my flex app onto my webpage, the scrollwheel causes the page to scroll instead of zooming in and out...
Edit:
I have added sounds to my flex app and it tells me my mouse events are correct. I have also added an alertbox to the javascript so that I know the MyApp.initialize function is being called but the mousewheel is still scrolling the webpage instead of my flex app. This is the code I'm using and it isn't locking the scrollbar when I am on top of my flex application:
var bname;
var MyApp = {
initialize : function() {
this.debugging = true;
this.busyCount = 0;
this._debug('initialize');
bname = navigator.appName;
//alert(bname + ‘ is browser’);
document.getElementById('flashDiv').onload = this.start;
if(window.addEventListener)/** DOMMouseScroll is for mozilla. */
window.addEventListener('DOMMouseScroll', this.wheel, false);
/** IE/Opera. */
window.onmousewheel = document.onmousewheel = this.wheel;
if (window.attachEvent) //IE exclusive method for binding an event
window.attachEvent("onmousewheel", this.wheel);
}
, start : function() {
window.document.network_map.focus();
}
, //caputer event and do nothing with it.
wheel : function(event) {
if(this.bname == "Netscape") {
// alert(this.bname);
if (event.detail)delta = 0;
if (event.preventDefault) {
//console.log(’prevent default exists’);
event.preventDefault();
event.returnValue = false;
}
}
return false;
}
, _debug : function(msg) {
if( this.debugging ) console.log(msg);
}
};
I have got to be missing something!?