A friend asked me today how to create a simple slider component… I told him, the simplest way in flex, would probably be to have a MoveEffect that would just move a container.

So basically you use masking to mask some stuff, then turn off horizontalScrollPolicy, and verticalScrollPolicy, and then you just set the moveEffect.xBy to -100 or positive 100, (depending on the distance you want to move it, and what your trying to show… here is a really simple example.

Please don’t take this code too seriosly, it’s nothing fancy, it’s super simple, and all you would have to do to spice it up would be add a black background, and reflection or two, some images instead of vbox’s, and some better looking buttons with arrow icons… but i’m not the one who needs the component, so I’m not gonna put too much more time into this… (not that it took long)


Application – Source