?
Solved

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

Posted on 2009-03-30
3
Medium Priority
?
1,251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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 select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 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