Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-19-2012, 12:35 PM   #1
joenowhere
Registered User
 
Join Date: Jun 2011
Posts: 14
Default [AS3] Slider Component

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? Thanks a lot!!

below is my AC

Quote:
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;
}
Attached Files
File Type: zip test.swf.zip (18.4 KB, 39 views)

Last edited by joenowhere; 04-19-2012 at 12:37 PM.
joenowhere is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:55 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.