Creating Custom Sliders For All Purpose Programming in Flash Actionscript 3.0
Learn how to create any style custom slider you require for manipulating content or multimedia within Flash CS5, CS4, or CS3.


38 thoughts on “Creating Custom Sliders For All Purpose Programming in Flash Actionscript 3.0”

  1. Hey, great tutorial! Do you know how to code this slider to scrub through the timeline? I originally was using the built in component slider to do so and it was working fine. Then I decided to update the slider with a custom one and now the code no longer works. Here's the code I was using:

    function moveAlong(evt:Event):void {

    mySlider.minimum = 1;
    mySlider.maximum = this.totalFrames;
    mySlider.liveDragging = true;
    mySlider.addEventListener(Event.CHANGE, moveAlong);

    any help would be awesome!

  2. At around 5:00 – 7:00, when I'm putting in the code, I get Compiler Errors like Scene 1, Layer 'AS3', Frame 1, Line 9, 1120: Access of undefined property sliderKnob. What am I doing wrong here?

  3. Better late than never I guess. What you have to do to achieve that is to add the event listener to the stage itself instead of the sliderKnob. stage.addEventListener. You also want to delete the line sliderKnob.addEventListener(Mo­useEvent.MOUSE_OUT, stopDragging);

  4. So how to implement this correctly?
    add this to the stopDragging:
    then run it, and you will see a value when you let loose. just put the knob to 100%, and hold on to the number.
    then go into object, and see what the x value is of the Track. then do (Track.x – value)/2 and you got your own value!

    NOTE: i also dit implement the stage.addEventListener in stead of sliderKnob.addEventListener to the stopDragging function. Hope its all clear 😀

  5. Nice video!
    I have added something to it, though.
    What I missed here, is when you click anywhere in the slider, your knob will move there.
    Sooo.. I programmed that.

    //enable click anywhere on track
    function startDraggingViaClick(event:MouseEvent)
    sliderKnob.x =;

  6. Ive delete the:
    sliderKnob.addEventListener(MouseEvent.MOUSE_OUT, stopDragging);
    but it stops only if i click on sliderKnob
    what do i have to put so if i let go mouse button outside the slider

  7. easy fixes are nice but are not flexible, now look what applied maths student can suggest you

    sldMovArea = sld_background.width – sld_knob.width;
    sliderValue = (sld_knob.x/sldMovArea) * 100;

    like this you can change slider width from code regardless what's your slider knob and slider background width is

Leave a Reply

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