Link to home
Start Free TrialLog in
Avatar of dsrnu
dsrnu

asked on

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

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

ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dsrnu
dsrnu

ASKER

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.



Avatar of dsrnu

ASKER

Thank you very much.