Solved

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

Posted on 2009-03-30
3
1,228 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to disable  HTML5 video in chrome 2 1,554
FLV versus SWF 11 277
Adobe flash player fails to install 12 307
Advertising design for my own Purpose 5 81
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. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

809 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