I am developing an application which involves scrolling an
image.The app has some "cursor" images which user can press his/her
mouse and continuously scroll the image file.However,both MouseDown
and MouseClick is only invoked once everytime user push his
mouse.How can I invoke the MouseDown and/or MouseClick event
continuously instead once every click?
You cannot, since these are events, and an event cannot be
continuous. What you'll need to do is maintain your own variable
which tracks the scroll on/off state. Add event listeners for
MouseDown and MouseUp, and use these to set the scroll on and off.
You may wish to consider listening for MouseUp on the stage or the
application, rather than on the control, since the use can click,
move and release the mouse over a different part of your
You will then need to add a timer to check your scroll
variables and scroll up/down incrementally by modifying
verticalScrollPosition and horizontalScrollPosition.