Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

Video Timecode

Cow Forums : Adobe Flash

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Video Timecode
by ChrisHood on Sep 27, 2005 at 11:47:05 am

I want to display the seconds and minutes of a video clip ticketing away as the video plays. I currently have this code working (sort of). The problem is the time only goes up and random spots instead of every second. I would guess I would need it to recheck the Status every so often. Any help?

ns.onStatus = function(infoObject:Object) {
//var ts = ns.time
//thisLength.text = ts;
ns_seconds = ns.time;
minutes = Math.floor(ns_seconds/60);
seconds = Math.floor(ns_seconds%60);
if (seconds<10) {
seconds = "0"+seconds;
}
thisLength.text = minutes+":"+seconds;
trace(minutes);
trace(seconds);
trace(ns_seconds);

}



Respond to this post   •   Return to posts index

Re: Video Timecode
by Matt Klundt on Sep 27, 2005 at 4:04:48 pm

Your current code only will display when an event such as the buffer being full, or the video stopping.

If you want it to display constantly, set it to an interval. such as:

var timeInterval;
timeInterval = setInterval(timeTest, 50);

function timeTest() {
    ns_seconds = ns.time;
    minutes = Math.floor(ns_seconds/60);
    seconds = Math.floor(ns_seconds%60);
    if (seconds<10) {
        seconds = "0"+seconds;
    }
    thisLength.text = minutes+":"+seconds;
}

Matt
--------------------
www.mcquillendesign.com
www.mattfoxgames.com

Respond to this post   •   Return to posts index

Re: Video Timecode
by ChrisHood on Sep 27, 2005 at 4:14:57 pm

That did it. Thanks, worked perfectly.

Chris

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]