Curve-Constrained Scrolling in Actionscript

I’ve received a few inquiries in recent weeks regarding parametric curves used as paths for a nonlinear scrolling UI element.  Essentially, a sprite is constrained to be dragged along a curve representing an outline of some part of the UI.  I’ve had to do this for more than one project, so some time ago I authored a TechNote on the process.

The TechNote starts with a simplistic timeline-based approach and then discusses some different approaches for handling the problem entirely in script.  This allows the method to be expanded to UI elements that are dynamically created.

Scrolling constrained to the outline of a UI element
Scrolling constrained to the outline of a UI element

Recently, some of the projection computations were used in the Degrafa quadratic Bezier join method.


5 thoughts on “Curve-Constrained Scrolling in Actionscript

  1. You just reminded me of a time I did this back in Flash 4 or 5. Tweened a slider handle along a curved path and used gotoAndStop controlled by the mouse position. 🙂

  2. This is cool – I have a comp-sci project coming up that I think I can use this on. I’m going to try and write it in Flex.

Comments are closed.