property pTextMember -- the text cast member for displaying the video time property pSprite -- the sprite channel of the video property pCurrentString -- the current video time value as a string property pShowMinutes -- the following properties control the time display options property pShowSeconds property pShowMinSec property pShowMinSecCents property pShowSecCents property pShowCents ----------------------------------------- -- Displays video time in a text member. -- -- Behavior by Ken Loge -- http://diginoodles.com ----------------------------------------- on getPropertyDescriptionList me list = [:] addProp list, #pSprite, [#comment: "Sprite Channel of the Video:", #format: #integer, #default: 1] addProp list, #pTextMember, [#comment: "Text Member for Video Time Display:", #format: #text, #default: ""] addProp list, #pShowMinSec, [#comment: "Display Minutes and Seconds Only:", #format: #boolean, #default: 1] addProp list, #pShowMinSecCents, [#comment: "Display Minutes, Seconds, 100ths:", #format: #boolean, #default: 0] addProp list, #pShowSecCents, [#comment: "Display Seconds, 100ths Only:", #format: #boolean, #default: 0] addProp list, #pShowMinutes, [#comment: "Display Minutes Only:", #format: #boolean, #default: 0] addProp list, #pShowSeconds, [#comment: "Display Seconds Only:", #format: #boolean, #default: 0] addProp list, #pShowCents, [#comment: "Display 100ths Only:", #format: #boolean, #default: 0] return list end on exitFrame me videoTime = sprite(pSprite).currentTime videoMinutes = videoTime / 60000 videoSeconds = videoTime / 1000 videoCents = videoTime / 100 videoSeconds = videoSeconds - videoMinutes * 60 -- handle cents and tenths if videoCents < 10 then videoCents = "0" & videoCents end if -- handle seconds if videoSeconds < 10 then videoSeconds = "0" & videoSeconds end if if videoSeconds > 59 then videoSeconds = videoTime mod 60 end if -- handle minutes if videoMinutes < 10 then videoMinutes = "0" & videoMinutes end if if videoMinutes > 59 then videoMinutes = videoMinutes mod 60 end if -- handle time display options if pShowMinutes = 1 then videoTime = videoMinutes end if if pShowSeconds = 1 then videoTime = videoSeconds end if if pShowCents = 1 then videoTime = videoCents end if if pShowMinSec = 1 then videoTime = videoMinutes & ":" & videoSeconds end if if pShowSecCents then videoTime = videoSeconds & "." & videoCents end if if pShowMinSecCents = 1 then videoTime = videoMinutes & ":" & videoSeconds & "." & videoCents end if -- update text member only if value has changed if videoTime <> pCurrentString then member(pTextMember).text = string(videoTime) pCurrentString = videoTime end if end