...

View Full Version : Slider Component



joenowhere
04-29-2012, 04:12 PM
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;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum