2 Replies Latest reply on Jun 2, 2010 11:09 AM by KMK_media_group

    scroll panel easing?


      I have seen a few examples of creating a scroll panel in Illustrator/Photoshop and then making it functional in Catalyst but I am just curious, is there a way to add easing to the scroll in Catalyst? You know so it speeds up and/or slows down as you scroll?

        • 1. Re: scroll panel easing?
          Peter Flynn (Adobe) Adobe Employee

          It sounds like you want the scroll speed to gradually increase if the user holds down the scrollbar's up/down arrows?


          There's no way to do this directly within Flash Catalyst, but if you're comfortable writing some code, it should probably be doable in a tool like Flash Builder.  You can create a custom subclass of VScrollBar (or HScrollBar) to add this behavior.  A rough outline might look something like this:


          • Attach listeners for CHANGE_START and CHANGE_END so you know when the user begins holding the button down and when they release it.
          • Override changeValueByStep() to do something like this:
            • Decide how much "acceleration" you should apply.  You can probably do this just by counting how many times changeValueByStep() has been called since the last CHANGE_START event (or better yet, how many msec have ellapsed since that event).
            • Set the stepSize property to a value reflecting the current "speed."
            • Call super.changeValueByStep() to let the original Flex SDK code do the scrollbar position update.
          • When CHANGE_END occurs, always reset stepSize back to its original value so that single-clicking on the up/down arrows moves by the normal amount.


          Hope that helps,


          - Peter

          • 2. Re: scroll panel easing?
            KMK_media_group Level 1

            Thanks, you answered my main question of "can it be done in catalyst?" On one hand I was pretty sure you couldn't but on the other hand, designers like me think to themselves....why not? You can control the transition and easing of other states, why not this? In other words as Catalyst evolves, to me, it seems like having easing control over just about any animation or anything you interact with (such as a scroll panel) would be standard, keeping up with todays sites.


            I appreciate the extra step you went with giving me the code, but was hoping to not have to go there, especially since thats what catalyst was shooting for. I do use flash cs4, and use a combination of timeline animation and actionscript, but my actionscropt knowledge is VERY minor. I usually use snippets of code from other sources, and tweak it if I can. Usually taking me a long time to figure out how to tweak it to my needs.


            Again, thanks for the reply.