Solved

How do I continuously update a current time text display with FLVPlayback?

Posted on 2009-03-30
3
1,222 Views
Last Modified: 2013-11-11
Hi,

I have the FLVPlayback component in an AS3 document.

I have found that the current time of the FLV video is available via

myFLVPlayback.playheadTime (considering myFLVPlayback is the instance name of my object)

BUT this variable only gets updated every "state change" via a listener that calls a function every "stateChange"

How do I continuously update this text box to display the most up to date value of playheadTime? I know that NetStream's netStream.time works very well, but I'd rather not recode using netstreams.

PS. I have a dynamic text box named CURRENTTIME.

Thank you.


function listenerObjectStateChange(eventObject:Object):void {

    controlsMC.CURRENTTIME.text = formatTime(vid.playheadTime);

};

vid.addEventListener("stateChange", listenerObjectStateChange);

Open in new window

0
Comment
Question by:dsrnu
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 24027314

            var myTimer:Timer = new Timer(1000, 2);
            myTimer.addEventListener("timer", timerHandler);
            myTimer.start();


        function timerHandler(event:TimerEvent):void {
            controlsMC.CURRENTTIME.text = formatTime(vid.playheadTime);
}

       something along these lines should work
0
 

Author Comment

by:dsrnu
ID: 24033849
Perfect! Thank you!

I inserted myTimer.start() inside the (initial) play button, and changed the repeat on the timer to the total time of the video.



0
 

Author Closing Comment

by:dsrnu
ID: 31564683
Thank you very much.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Action Script commands 3 207
Action Script coding 1 170
Adobe Products Forum? 3 136
Running Mp4 or Flash Video 1 83
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now