July 11, 2008

Custom Scrollbar Class using Flash and AS3

I recently wrote this AS3 class to create custom scrollbars in Flash. If you would like to download the example and class, you can do so here.

Copy and paste some text or just hit ‘Enter’.

This first class is the document class that imports the CustomScroll class. One thing that you’ll want to take note of is how we have to pass a reference of the main timelines stage object to the CustomScroll class constructor. For an explanation as to why we have to do this, check out Senocular’s comments on the Kirupa.com forum or google “as3 access to stage and root”.

And this is the CustomScroll class:

If you’re new to AS3 or if you’re having trouble getting the example to work, make sure to designate a class path to the parent folder of ‘CustomScroll.as’ called ‘classes’. I should also mention that in the examples 1, 3 & 4, the opacity of movie clip ‘track_mc’ has been set to zero in order that it be made invisible.

Have fun.

One thought on “Custom Scrollbar Class using Flash and AS3

Leave a Reply

Your email address will not be published. Required fields are marked *