Tutorial... tutorial... none needs tutorials for such easy task. All you have to do is to declare a Point
in which you store the mouse position when the user clicks/touches and then calculate the offsets for the container when the user moves the mouse/swipes. For example, if the user clicks at (200,200), and swipes down 50px, then your container's y position should be container.y-(200-50)
.
So as the user swipes down, the content goes up. And for a limit, just set a limit for the container's y position (must be negative).
AS3 movieclip scrolling
-
25-06-2023 - |
Question
I ran into a problem which that I have a function "PlaceOneSpawn" which will spawn a MovieClip "A_Y" that will addChild into a movieclip Container.
Everything spawns and everything works, I spawn everything in the timeline Actions by calling the function.
I couldn't find a tutorial anywhere that shows a movieclip drag scroller (Like iOS scrolling) for vertical scrolling with .y limiter using a class.
Most of the tutorials out there only use a direct timeline action coding, I want to try to stay clear of that type of coding if possible.
Thanks in advance!
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow