Skip to main content
Known Participant
December 2, 2018
解決済み

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.
  • 400 ビュー

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()

}

    このトピックへの返信は締め切られました。
    解決に役立った回答 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

    kglad
    Community Expert
    kgladCommunity Expert解決!
    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.

    olinh26627966作成者
    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.