Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scrol bar to slow down a video and audio file

Contributor ,
Feb 26, 2014 Feb 26, 2014

Hello,

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

Thank you.

TOPICS
ActionScript
539
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2014 Feb 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;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 27, 2014 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 27, 2014 Feb 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);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 01, 2014 Mar 01, 2014

Thank you Kglad,

 

I tried the script, but apparently I make some mistakes,

keep in mind that I am a newbie of flash, I would be grateful  if you could attach a .fla.

Thank you again very much

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2014 Mar 01, 2014
LATEST

nothing was attached.

in addition, i don't download and correct files unless i'm hired.

free help i offer via the adobe forums and this problem is simple enough it can probably be solved in this forum. 

if you want to hire me, send an email via http://www.kglad.com.  to solve in this forum, copy and paste the code you're using.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines