I am trying to develope a custom Numeric Stepper using ZoomIn/ZoomOut images as scroller.
Now I want to handle continuos MouseDown event. The problem is that the MouseDown event is triggered only once. But, I want a behaviour of MouseDown to be similar of Flex NumericStepper. The longer we press and hold the scroller, the faster the numbers are increased. I tried using timer which starts on mouseDown and stops on MouseUp. But the problem is that, timer ticks at constant intervals and I cannot achieve the behavious of NumericStepper.
Can anybody please help me out on this issue.
Numeric stepper is using a timer.
On mouseDown, add 3 event listeners: (A) mouseup, (B) rollOut, and (C) enterframe.
Until the user triggers the (A) mouseup, or (B) rollOut event, you can consider the mousebutton to be down and over the component. While the button is down you can listen to the enterFrame event firing on each frame, or alternatively, you could use a timer to continously call a function.