Flex 4.6 Scroller - 是否可以通过 Actionscript 暂时禁用滚动?

发布于 2024-12-27 23:04:38 字数 564 浏览 1 评论 0原文

我正在尝试制作一个移动应用程序,允许使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

〗斷ホ乔殘χμё〖 2025-01-03 23:04:38

我只是想自己做这件事,我想我有一个可行的答案。

您需要做的是设置verticalScrollPolicy(和/或水平)。您可以通过 setStyle 方法执行此操作:

scrollerObject.setStyle('verticalScrollPolicy', ScrollPolicy.OFF);

显然,要重新启用滚动,只需将策略设置回 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:

scrollerObject.setStyle('verticalScrollPolicy', ScrollPolicy.OFF);

Obviously to re-enable scrolling just set the policy back to ON.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文