Forward……maaaaaach.

Thursday, July 16th, 2009 by Kiz | | Keith Morgan's Blog, teh internets | No Comments | Print This Post Print This Post

No Gravatar

More Flash video player PDL code. This time, Fast forward and reverse. Basically you set a timer that counts for you.


private const PLAYHEAD_UPDATE_INTERVAL_MS:uint = 10;
public var rewFF:Timer = new Timer(PLAYHEAD_UPDATE_INTERVAL_MS);


public function ffcontroller():void {
< button >.removeEventListener(MouseEvent.MOUSE_DOWN, ffcontroller);
video.pause();
rewFF.start();
rewFF.addEventListener(TimerEvent.TIMER, ffmotioncontroller);
this.addEventListener(MouseEvent.MOUSE_UP, ffstopcontroller);
}
public function ffstopcontroller(pEvent:MouseEvent):void {
rewFF.stop();
rewFF.removeEventListener(TimerEvent.TIMER, ffmotioncontroller);
rewFF.reset();
video.play();
ffBtn.addEventListener(MouseEvent.MOUSE_DOWN, ffcontroller);
}
public function ffmotioncontroller(event:TimerEvent):void {
elapsedTime = (time_elapsed + rewFF.currentCount);
video.seek(Number(elapsedTime.toFixed(1)));
}

…for reverse, just subtract the time_elapsed from the current count. You will also need a good number of frames embedded in your video for this to look cool.

Enjoy!

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Technorati
  • TwitThis
  • Mixx
  • Google Bookmarks
  • NewsVine
  • Yahoo! Buzz
  • Reddit
  • StumbleUpon
  • Slashdot
  • LinkedIn
  • MySpace
  • email
  • Fark
  • Live
  • Ping.fm
  • RSS
  • Yahoo! Bookmarks

Tags: , , , , ,

No comments yet.

Leave a comment

You must be logged in to post a comment.

Find

Currently

There are no events to show at this time.

Fix