所有其他浏览器都可以(请参阅 bottom mid)。我只能在Chrome(所有版本)中滚动列表。我使用这段代码:
package com.spikything.utils
{ import flash.events.Event;
import flash.events.MouseEvent;
import flash.external.ExternalInterface;
import fl.controls.*;
public class MouseWheelTrap
{ static private var _mouseWheelTrapped:Boolean;
public static function setup(list:List):void
{
list.addEventListener(MouseEvent.MOUSE_OVER,function():void { allowBrowserScroll(false); });
list.addEventListener(MouseEvent.MOUSE_OUT,function():void { allowBrowserScroll(true); });
}
private static function allowBrowserScroll(allow:Boolean):void
{
createMouseWheelTrap();
if (ExternalInterface.available)
{
ExternalInterface.call("allowBrowserScroll",allow);
}
}
private static function createMouseWheelTrap():void
{
if (_mouseWheelTrapped)
{
return;
}
_mouseWheelTrapped = true;
if (ExternalInterface.available)
{
ExternalInterface.call("eval","var browserScrolling;function allowBrowserScroll(value){browserScrolling=value;}function handle(delta){if(!browserScrolling){return false;}return true;}function wheel(event){var delta=0;if(!event){event=window.event;}if(event.wheelDelta){delta=event.wheelDelta/120;if(window.opera){delta=-delta;}}else if(event.detail){delta=-event.detail/3;}if(delta){handle(delta);}if(!browserScrolling){if(event.preventDefault){event.preventDefault();}event.returnValue=false;}}if(window.addEventListener){window.addEventListener('DOMMouseScroll',wheel,false);}window.onmousewheel=document.onmousewheel=wheel;allowBrowserScroll(true);");
}
}
}
}
在主要班级:
MouseWheelTrap.setup(this.previewScrollBox);
this.previewScrollBox.addEventListener(MouseEvent.MOUSE_WHEEL, this.showData);
这个javascript代码 - swfobject.js