Flex 4.6 Scroller - 是否可以通过 Actionscript 暂时禁用滚动?
我正在尝试制作一个移动应用程序,允许使用 startDrag() 和 stopDrag() 拖放某些元素。这些元素被封装在火花滚动器内。当有人与可拖动对象交互时,我想禁用滚动器,但似乎无法让滚动器不响应。
这是我尝试过的事情。
protected function draggableObjectOnMouseBegin(e:MouseEvent):void {
scrollerObject.enabled = false;
scrollerObject.mouseEnabled = false;
scrollerObject.mouseFocusEnabled = false;
draggableObject.setElementIndex(e.currentTarget as IVisualElement, dragabbleObjectGroup.numElements-1);
e.currentTarget.startDrag();
}
但滚动条不会停止滚动。我是否遗漏了某些内容,或者没有什么办法可以暂时停止滚动条的滚动能力,以允许对滚动条中包含的对象进行拖放类型操作。
I am trying to make a mobile app that would allow a drag and drop of certain elements using startDrag() and stopDrag(). These elements are enclosed inside of a spark scroller. I would like to disable the scroller when someone is interacting with the draggable objects, but can't seem to get the scroller to not respond.
Here are the things I have tried.
protected function draggableObjectOnMouseBegin(e:MouseEvent):void {
scrollerObject.enabled = false;
scrollerObject.mouseEnabled = false;
scrollerObject.mouseFocusEnabled = false;
draggableObject.setElementIndex(e.currentTarget as IVisualElement, dragabbleObjectGroup.numElements-1);
e.currentTarget.startDrag();
}
But the scroller will not stop scrolling. Am I missing something or is there no wat to temporarily stop a scrollers ability to scroll to allow for drag and drop type operations on objects enclosed in a scroller.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是想自己做这件事,我想我有一个可行的答案。
您需要做的是设置
verticalScrollPolicy
(和/或水平)。您可以通过 setStyle 方法执行此操作:显然,要重新启用滚动,只需将策略设置回 ON 即可。
I just trying to do exactly this this myself and I think I have a working answer.
What you need to do is set the
verticalScrollPolicy
(and/or horizontal). You do this via the setStyle method:Obviously to re-enable scrolling just set the policy back to ON.