2 Replies Latest reply on Mar 6, 2009 11:15 PM by thedex1

    Custom Scrolling

    thedex1 Level 1
      Hi, how are you? Actually I am making an application similar to an Image Gallery. I am using HBox to display thumbnails of images on a strip. My question is:

      "Is it possible to use images as Left and Right scroll buttons and use mouseOver event instead of click event to scroll the HBox???"

      Here is the code for strip:

      <mx:Canvas id="strip_container" width="80%" height="100" verticalScrollPolicy="off" horizontalScrollPolicy="off">
      <mx:HBox id="strip" width="95%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" />
      </mx:Canvas>

      I tried it by decrementing and incrementing the "x" position of HBox to scroll it left and right respectively but in that case, it scrolls the HBox just 1 pixel left or right and then stop.
      I want HBox to continuously scroll in a direction as long as the mouse is OVER THE IMAGE.

      I also tried to use custom image using CSS but it shows very small image. I want to use an image which is abut 50px high.

      Any suggestions or help will be greatly appreciated.

      Thanks a lot ...

      .:.WAHAB
        • 1. Re: Custom Scrolling
          Level 7
          I'm not really sure what to say about your CSS problem, but it is
          possible to have it automatically scroll while the mouse is over the
          image. On roll over, you can start a timer, and have that timer change
          the position every time it fires. Then, on roll out, you stop the timer.

          Let me also put in a warning that I implemented exactly this
          functionality once, and found that it was incredibly confusing for the
          user. Mouse movements are generally viewed by the user to be passive.
          They're used often as an extension of the user's focus. By making mouse
          movements trigger an active process that changes the user's choices, it
          can feel like you're breaking that contract. It could work better in
          your application, but it's something to be wary of.
          • 2. Re: Custom Scrolling
            thedex1 Level 1
            oh thanks for the suggestion. I used the Timer to get the required result. Thanks for your suggestion.

            .:.WAHAB