Jump to content
Search Community

edge swipe detection

ladyb314 test
Moderator Tag

Recommended Posts

Hello,

I am currently using the WONDERFUL PanelScroll example shown for tweenlite which allows me to swipe/flick through my images. I have a little twist I need to add on this though and am not sure how.

 

I want to detect where the user started the swipe from. What I need is a true "Edge" swipe. So if the user swipes from the middle this should not count as a swipe, just from the edges. I have been googling for days now and don't see how to achieve this. I would guess it has something to do with my touch boundaries, but I'm not sure how to tweak this using the Panel Scroll example.

 

Any ideas?

 

Any help would be greatly appreciated. by the way I LOVE your products!!!!

Link to comment
Share on other sites

I can't really rework those files right now, but I would suggest that in the mouseDownHandler you record the mouseX in a variable called startSwipeX.

 

in the mouseUpHandler see if

 

Math.abs(mouseX - startSwipeX) // will give you the distance of your swipe

 

is a value close enough to the width of your stage. hopefully that gives you some ideas.

 

also if you are using TouchEvents I believe they have a stageX value that you can use

http://help.adobe.co...ent.html#stageX

 

edited: original post had used Y in some places mistakenly

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...