Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-19-2012, 12:35 PM   #1
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

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

amount.text = "1";

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

mcSlider.liveDragging = true;
mcSlider.minimum = 1;
mcSlider.maximum = 10;
mcSlider.tickInterval = 1;

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);

function doSliderChange(e:SliderEvent):void {
amount.text = e.target.value;
Attached Files
File Type: zip test.swf.zip (18.4 KB, 41 views)

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

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 06:57 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.