Skip to main content
Known Participant
December 2, 2018
Answered

need a way to run y with ui scrollpane while scrolled down or figure out the y of the scroll pane

  • December 2, 2018
  • 1 reply
  • 399 views

basically I am moving an object out of the scroll pane and to a new parent myblank3all but if I am scrolled down the re-parent no longer holds the same y so when I drag the object out of the scroll pane its y is different and gets further off as I go down.   When I scroll down and stop every object in the scrollpane is the same distance off.  so I think if I could get the value of the top y or bottom y of the scrollpane but it has to be relative to the scrollpanes symbol that it holds then I could figure it out

function fl_drag(event: MouseEvent): void {

myblank3all = new MovieClip()

myblank3all.addChild(event.currentTarget.parent)

myblank3all.y = myblank3all.y + some number

myblank3all.startDrag()

}

    This topic has been closed for replies.
    Correct answer kglad

    you can use the verticalScrollPosition to get the y of the object in the scrollpane but you probably just want to reposition at about the same y as the scrollpane, don't you?

    or, even better, use the mouseY.

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    December 2, 2018

    you can use the verticalScrollPosition to get the y of the object in the scrollpane but you probably just want to reposition at about the same y as the scrollpane, don't you?

    or, even better, use the mouseY.

    Known Participant
    December 2, 2018

    I was working with mouseY it didn't seem to help but yea I want re-positioned to stay in the same spot.  I will play around more with all your suggestions and see if I can figure it out.