1

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.

ketan
  • 19,129
  • 42
  • 60
  • 98
treylok
  • 13
  • 1
  • 4

1 Answers1

4

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.

Marvin Pinto
  • 30,138
  • 7
  • 37
  • 54
Jamie
  • 56
  • 1