# Slider Component

**URL:** <https://forum.kirupa.com/t/slider-component/328237>\
**Category:** Uncategorized\
**Created:** [April 30, 2012, 12:55pm UTC](https://forum.kirupa.com/t/slider-component/328237 "2012-04-30T12:55:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joenowhere](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@joenowhere](https://forum.kirupa.com/u/joenowhere)\
**Post date:** [April 30, 2012, 12:55pm UTC](https://forum.kirupa.com/t/slider-component/328237/1 "2012-04-30T12:55:39Z")

</div>

I want to make a flash with a Slider Component to control mc, like the file I attach, is there any way to add a classic tween effect in between each mc, so that it will transform smoothly? Thanks a lot!!

below is my AC

> import fl.controls.Slider;  
> import fl.events.SliderEvent;  
> import flash.events.Event;

amount.text = “1”;  
mcTest.gotoAndStop(1);

var mcSlider:Slider = new Slider();  
var animLength : int = mcTest.totalFrames;  
var calcWidth : Number = mcSlider.maximum / animLength;  
var animPlaying : Boolean = false;

mcSlider.move(20,100);  
mcSlider.liveDragging = true;  
mcSlider.setSize(500,0);  
mcSlider.minimum = 1;  
mcSlider.maximum = 10;  
mcSlider.tickInterval = 1;  
addChild(mcSlider);

mcSlider.addEventListener(SliderEvent.CHANGE, doSliderChange);  
mcTest.addEventListener(Event.ENTER\_FRAME, scrubMovie);

function scrubMovie(evt:Event):void  
{  
var scrubPos : int = mcSlider.value;  
var gotoFrame : int = Math.ceil(scrubPos / calcWidth);  
mcTest.gotoAndStop(gotoFrame);  
}

function doSliderChange(e:SliderEvent):void {  
amount.text = e.target.value;  
}
