Alright, I did a fair amount of readin yesterday and found a pretty good solution to my issue, and far more simple than the code posted above.
So instead of using the duration function, and then subtracting to display the elapsed time, there's a function specifically for this type of usage.
I used the currentTime, and that automatically updates as the video moves along.
So here's the code to get this working:
go to the frame
member("mytextfield").text = string(framestoHMS(sprite("myvideo").currentTime, 30, 0, 0))
This returns the current time of the video, in minutes, seconds, milliseconds.
The only remiaing question is how to parse and shorten that string into just minutes and seconds...
So instead of 00:19:00.16, I'd want 00:19.
I'd imagine the simplest method would be to grab the first 5 characters by using the char function, but couldn't get that to work.
1 person found this helpful
member("mytextfield").text = string(framestoHMS(sprite("myvideo").currentTime, 30, 0, 0)).char[1..5]
Thats it, thanks Mike I appreciate the assistance.
Anyway, I do have another quick one:
Now that I have everything displaying correctly I noticed the times are off; the timecode I'm displaynig seems to be way behind the video.
After some trial and error I realized I could just use the .duration function to display the full time of the video and sure enough it's way off. I ended up having to change the tempo in FramestoHMS to 17. I could understand 15, but 17 is an unsual framerate...
Any ideas on that one?
It works, so I'm not complaining, but suspect I may be doing something wrong...