Skip to main content
Jhon Carlo
Inspiring
February 26, 2014
Question

Scrol bar to slow down a video and audio file

  • February 26, 2014
  • 1 reply
  • 567 views

Hello,

I need a scrol bar to slow down a video file (video and audio)

Thank you.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
February 26, 2014

you can use the paramF to calculate the parameters needed to associate the scrollbar's position with the video's position.  is your video being played in an flvplayback component?

function paramF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):void{

mc.m=(y1-y2)/(x1-x2);

mc.b=y1-mc.m*x1;

}

Jhon Carlo
Inspiring
February 27, 2014

Thanks  for you kindly reply.

I do some test but I am new to As3, so could you write a short complete script please?

I did some testing and I think slow down with FLVPlayback component is not possible, is that right? So if there are no alternatives, my intention would be to use the time line.

Keep in mind that I have to slow down video and audio simultaneously.

 

Thanks a lot.

kglad
Community Expert
Community Expert
February 27, 2014

you want a video to play at something other than its native framerate?

if yes, you can't easily do that with an flvplayback component.  you'll need to separate the audio and visual parts of your video and had them to a movieclip timeline.  then you'll need to customize the playback speed of that movieclip.

you can use the following to play any movieclip (forward or backward) at any speed:

function playF(mc:MovieClip, m:int, n:int, fps:int):void {

    var playFFF2:Function = function(mc:MovieClip):void {

        trace(getTimer(),mc.currentFrame);

        if (mc.m<mc.n) {

            mc.nextFrame();

        } else {

            mc.prevFrame();

        }

        if (mc.currentFrame == mc.n) {

            clearInterval(mc.int);

        }

        //updateAfterEvent();

    };

    mc.m = m;

    mc.n = n;

    mc.fps = fps;

    mc.gotoAndStop(mc.m);

    clearInterval(mc.int);

    mc.int = setInterval(playFFF2, 1000/mc.fps, mc);

}

// and to stop it:

function stopF(mc:MovieClip):void {

    clearInterval(mc.int);

}