Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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, 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;
    }
    Attached Files Attached Files


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •