2 Replies Latest reply on Jan 9, 2007 5:50 AM by d8888

    Mouse event question

      I am new to both flex and AS.

      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?

      Sorry for my poor English,I am from Taiwad :D

      Thanks in advance
        • 1. Re: Mouse event question
          FlightGuy Level 1
          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 application.

          You will then need to add a timer to check your scroll variables and scroll up/down incrementally by modifying verticalScrollPosition and horizontalScrollPosition.

          • 2. Re: Mouse event question
            d8888 Level 1
            It worked smoothly

            Thanks! :D