Build a Dynamic Video Player with ActionScript 3: Part 3 of 3

Here it is, the final part of our video player tutorial! All we need to do now is get the time indicator working, add our home button click function, position and size the current video and get the featured bar filled with videos along with its scrubber. Let’s get started!

Step 1: Video Time
First we need to add a listener to the stage called videoTimeEnterFrame that updates the video time every frame. Add this line to the videoItemClick function.

stage.addEventListener(Event.ENTER_FRAME, videoTimeEnterFrame); // runs this function every time we enter a new frame

Now let’s add the videoTimeEnterFrame function.

function videoTimeEnterFrame(event:Event):void
{
var totalSeconds:Number = ns.time; // variable to hold the ns.time
var totalSeconds2:Number = duration; // variable to hold the duration
var minutes:Number = Math.floor(totalSeconds / 60); // variable to hold the rounded down totalSeconds divided by 60
var minutes2:Number = Math.floor(totalSeconds2 / 60); // variable to hold the…

You Might Also Like...

'>How to create a top quality logo for your company
  • Remove a Section of Your Photo
  • Subscribe to RSS headline updates from: GurusUnleashed
    Powered by FeedBurner

  • Design & Career Resources

    Open design job and RFQ/RFP listings for Thursday, 29 July Courtesy of Design Jobs Live!
    The latest resources and free stuff (like textures, fonts, Photoshop brushes, scripts, plug-ins, and much more!) from workflowFreelance.com. Read more!
    The latest headlines from workflowFreelance.com. Read more!
  • Popular Search Terms

    Curious what others are searching for? Below are the most popular search terms over the last 30 days.