Drag along x-axis & getting close to hitTest
Hi there,
I am trying to create something a little unique. Essentially I have a picture of a tiger and a human. When the user clicks and drags the tiger along the x-axis (only x-axis) and gets closer to the human, there is a 'risk bar' (similar to a progress bar) which goes up/down depending on how close the tiger is to the human. If 100% risk then user can move onto the next part.
I have an example that was created by the previous person in my job. He created it in Animate Edge however so I can't really look at his file.
https://drive.google.com/open?id=1CPBQJrgxw1ozg8fC4rLOuX20tixmUgo1
How I assume the process works:
1. create draggable object
2. find some sort of constrain for drags (x axis only?)
3. find a way to do 'almost hitTest'.
4. create a 'progress bar' - no idea how do do this.
a little push in the right direction should get me going
or some code if someone has done something similar.. or the exact names of what I am looking for if you know what they are called.
Thanks!