Custom touch slider

This is a tutorial for building a custom touch slider.

A little history
I was trying to fall asleep for who knows how long, when I was struck with inspiration. I would write it down on a sheet of paper and then send it to YYY, who I had heard was looking for one. I had not tested it out when I sent it to him, and he was more then skeptical. I, being stubborn as I am, had decided I would test out the SHORT code and see if it would work. Lo and behold I was left with what you see below and a working custom slider.

Current version
.9

- Working on fine tuning the code so that it will remember the position of the last touch and make that the original position for a smoother scroll.

What you will need
You will need two images: The Panel will be the section moving opposite to the scroller (slider).
 * Slider.png
 * Panel.png

The code - straight up
verbose 1000    1000       400       20       Slider.png slider 0 <![CDATA[ panel.vOffset = slider.vOffset - system.event.vOffset ]]> Panel.png panel 0 30

The reasoning
First I establish the basics, the tag and the tag to define the widget and the debugger, next I establish the window that the slider will fall under and then give the slider some properties. Here comes the key part. The  tag, inside here is what makes this slider tick. By finding the current mouse position inside the slider you can establish how far in the negative direction the panel has to move. You then insert the vOffset of the slider and subtract the mouse position (system.event.vOffset) to get the new panel position. There it is a working slider. If you make the slider draggable (like placing it in a new window, and insert the screen co-ordinate function instead (system.event.screenY) it should work like a drag slider instead of a touch slider, at least i hope.

Conclusion
Well there it is, a few quick and easy steps for building a touch slider and maybe even a drag slider :). Expect updates and post any confusions.