evt.preventDefault(); evt.stopImmediatePropagation();
<s:Application ......... creationComplete="init();"> ...... private function init() : void{ mapManager.map.addEventListener(MouseEvent.MOUSE_WHEEL,onMouseWheel,false,0); } private function onMouseWheel(evt:MouseEvent):void{ evt.preventDefault(); evt.stopPropagation(); }
// inside ViewerContainer.mxml <Script> tag
/**
* Listen creation complete handler
*/
private function init():
{
//...
initWheelEvents();
}
/**
* Init mouse wheel events listeners
*/
protected function initWheelEvents():void
{
if (mapManager && mapManager.map)
{
mapManager.map.addEventListener(MouseEvent.ROLL_OVER, mouseWheelOver);
mapManager.map.addEventListener(MouseEvent.ROLL_OUT, mouseWheelOut);
}
}
/**
* mouse wheel out handler
*/
protected function mouseWheelOut(event:MouseEvent):void
{
MouseWheel.release();
}
/**
* mouse wheel over handler
*/
protected function mouseWheelOver(event:MouseEvent):void
{
MouseWheel.capture();
}